Organization: Add category choices (make category dropdown field)

This commit is contained in:
PCoder 2021-11-26 19:35:59 +05:30
parent c8ba67f079
commit edda9afdce
2 changed files with 37 additions and 1 deletions

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-11-26 14:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0027_auto_20211126_1252'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='category',
field=models.TextField(blank=True, choices=[('Independent', 'Independent'), ('Public administration > Research Institution', 'Public administration > Research Institution'), ('Academia > University > Institute', 'Academia > University > Institute'), ('Academia > University', 'Academia > University'), ('Public administration > Other Agency', 'Public administration > Other Agency'), ('Private > NGO (not for profit)', 'Private > NGO (not for profit)'), ('Academia > Academy of Sciences', 'Academia > Academy of Sciences'), ('Academia > Academy of Sciences > Institute', 'Academia > Academy of Sciences > Institute'), ('Public administration > Government', 'Public administration > Government'), ('Intergovernmental Agency > Research Institution', 'Intergovernmental Agency > Research Institution'), ('Intergovernmental Agency', 'Intergovernmental Agency '), ('Private > Research Institution', 'Private > Research Institution'), ('Collection > Museum', 'Collection > Museum'), ('Private > Business', 'Private > Business'), ('Education > Graduate', 'Education > Graduate'), ('Collection > Botanical Garden', 'Collection > Botanical Garden'), ('Other', 'Other')], null=True),
),
]

View file

@ -344,6 +344,24 @@ class GMBA_function(models.Model):
class Organization(models.Model):
CATEGORY_CHOICES = (
('Independent', 'Independent'),
('Public administration > Research Institution', 'Public administration > Research Institution'),
('Academia > University > Institute', 'Academia > University > Institute'),
('Academia > University', 'Academia > University'),
('Public administration > Other Agency', 'Public administration > Other Agency'),
('Private > NGO (not for profit)', 'Private > NGO (not for profit)'),
('Academia > Academy of Sciences', 'Academia > Academy of Sciences'),
('Academia > Academy of Sciences > Institute', 'Academia > Academy of Sciences > Institute'),
('Public administration > Government', 'Public administration > Government'),
('Intergovernmental Agency > Research Institution', 'Intergovernmental Agency > Research Institution'),
('Intergovernmental Agency', 'Intergovernmental Agency '),
('Private > Research Institution', 'Private > Research Institution'),
('Collection > Museum', 'Collection > Museum'),
('Private > Business', 'Private > Business'),
('Education > Graduate', 'Education > Graduate'),
('Collection > Botanical Garden', 'Collection > Botanical Garden'),
('Other', 'Other'),)
org_num1 = models.AutoField(primary_key=True)
organisation_search = models.TextField(blank=True, null=True)
org_alpha_search = models.TextField(blank=True, null=True)
@ -367,7 +385,7 @@ class Organization(models.Model):
description = models.TextField(blank=True, null=True)
northing = models.TextField(blank=True, null=True)
easting = models.TextField(blank=True, null=True)
category = models.TextField(blank=True, null=True)
category = models.TextField(blank=True, null=True, choices=CATEGORY_CHOICES)
subject = models.TextField(blank=True, null=True)
def __str__(self):