Organization: Add category choices (make category dropdown field)
This commit is contained in:
parent
c8ba67f079
commit
edda9afdce
2 changed files with 37 additions and 1 deletions
18
app/migrations/0028_alter_organization_category.py
Normal file
18
app/migrations/0028_alter_organization_category.py
Normal 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),
|
||||||
|
),
|
||||||
|
]
|
|
@ -344,6 +344,24 @@ class GMBA_function(models.Model):
|
||||||
|
|
||||||
|
|
||||||
class Organization(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)
|
org_num1 = models.AutoField(primary_key=True)
|
||||||
organisation_search = models.TextField(blank=True, null=True)
|
organisation_search = models.TextField(blank=True, null=True)
|
||||||
org_alpha_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)
|
description = models.TextField(blank=True, null=True)
|
||||||
northing = models.TextField(blank=True, null=True)
|
northing = models.TextField(blank=True, null=True)
|
||||||
easting = 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)
|
subject = models.TextField(blank=True, null=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
|
|
Loading…
Reference in a new issue