Make MapUnit a dropdown

This commit is contained in:
PCoder 2021-11-28 12:28:23 +05:30
parent ee634a2a65
commit 194978b3e2
2 changed files with 24 additions and 1 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-11-28 06:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0035_rename_range_mountainrange'),
]
operations = [
migrations.AlterField(
model_name='mountainrange',
name='map_unit',
field=models.TextField(blank=True, choices=[('Aggregated', 'Aggregated'), ('Basic', 'Basic'), ('No', 'No')], null=True),
),
]

View file

@ -77,6 +77,11 @@ class RangeType(models.Model):
class MountainRange(models.Model):
MAP_UNIT_CHOICES = (
('Aggregated', 'Aggregated'),
('Basic', 'Basic'),
('No', 'No'),
)
id = models.AutoField(primary_key=True)
source_id = models.IntegerField(blank=True, null=True)
gmba_id = models.TextField(blank=True, null=True)
@ -89,7 +94,7 @@ class MountainRange(models.Model):
range_name_language = models.ForeignKey(Language, models.DO_NOTHING, blank=True, null=True, to_field='id')
mother_range = models.ForeignKey("self", models.DO_NOTHING, blank=True, null=True, to_field='id')
feature = models.ForeignKey(RangeType, models.DO_NOTHING, blank=True, null=True, to_field='id')
map_unit = models.TextField(blank=True, null=True)
map_unit = models.TextField(blank=True, null=True, choices=MAP_UNIT_CHOICES)
level = models.TextField(blank=True, null=True)
level_text = models.TextField(blank=True, null=True)
level_1 = models.TextField(blank=True, null=True)