Add filter ignore fields to zone model

This commit is contained in:
Dana Lambert 2021-11-10 13:11:13 +13:00
parent 41d61ce3c5
commit 841da813db
2 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Generated by Django 3.2.8 on 2021-11-09 22:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0005_auto_20211104_2246'),
]
operations = [
migrations.AlterModelOptions(
name='zone',
options={'ordering': ['name', 'variant', 'refined_variant', 'id']},
),
migrations.AlterModelOptions(
name='zoneimagesegment',
options={'ordering': ['segment_order', 'id']},
),
migrations.AddField(
model_name='zone',
name='ignore_location_filter',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='zone',
name='ignore_soil_order_filter',
field=models.BooleanField(default=False),
),
]

View file

@ -76,6 +76,8 @@ class Zone(models.Model):
refined_variant = models.CharField(null=True, blank=True, max_length=100)
redirect_habitat = models.ForeignKey(
HabitatImage, blank=True, null=True, on_delete=models.CASCADE, related_name='zone_redirects')
ignore_soil_order_filter = models.BooleanField(default=False)
ignore_location_filter = models.BooleanField(default=False)
def __str__(self):
refined_variant_str = f", {self.refined_variant}" if self.refined_variant is not None else ""