Simplify role
This commit is contained in:
parent
bab37a767e
commit
208157f8c1
3 changed files with 39 additions and 11 deletions
|
@ -354,4 +354,3 @@ admin.site.register(RangesPeople, PeopleRangeAdmin)
|
||||||
admin.site.register(TaxonRange, TaxonRangeAdmin)
|
admin.site.register(TaxonRange, TaxonRangeAdmin)
|
||||||
admin.site.register(PeopleResource, PeopleResourceAdmin)
|
admin.site.register(PeopleResource, PeopleResourceAdmin)
|
||||||
admin.site.register(RangeCountry, RangeCountryAdmin)
|
admin.site.register(RangeCountry, RangeCountryAdmin)
|
||||||
admin.site.register(Role)
|
|
||||||
|
|
25
app/migrations/0033_auto_20211128_0551.py
Normal file
25
app/migrations/0033_auto_20211128_0551.py
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
# Generated by Django 3.2.5 on 2021-11-28 05:51
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('app', '0032_alter_person_search_name'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.RemoveField(
|
||||||
|
model_name='peopleresource',
|
||||||
|
name='p_r_role',
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='peopleresource',
|
||||||
|
name='role',
|
||||||
|
field=models.TextField(blank=True, choices=[('', ''), ('Author', 'Author'), ('Chair', 'Chair'), ('Contributor', 'Contributor'), ('Coordinator', 'Coordinator'), ('Co - Chair', 'Co - Chair'), ('Editor', 'Editor'), ('Head', 'Head'), ('Member', 'Member'), ('Project partner', 'Project partner'), ('SSC', 'SSC')], null=True),
|
||||||
|
),
|
||||||
|
migrations.DeleteModel(
|
||||||
|
name='Role',
|
||||||
|
),
|
||||||
|
]
|
|
@ -737,20 +737,24 @@ class TaxonRange(models.Model):
|
||||||
return self.taxon if self.taxon else '--'
|
return self.taxon if self.taxon else '--'
|
||||||
|
|
||||||
|
|
||||||
class Role(models.Model):
|
|
||||||
id = models.AutoField(primary_key=True)
|
|
||||||
role = models.TextField(blank=True, null=True)
|
|
||||||
|
|
||||||
def __str__(self):
|
|
||||||
return self.role if self.role else '--'
|
|
||||||
|
|
||||||
|
|
||||||
class PeopleResource(models.Model):
|
class PeopleResource(models.Model):
|
||||||
|
ROLES_CHOICES = (
|
||||||
|
('', ''),
|
||||||
|
('Author', 'Author'),
|
||||||
|
('Chair', 'Chair'),
|
||||||
|
('Contributor', 'Contributor'),
|
||||||
|
('Coordinator', 'Coordinator'),
|
||||||
|
('Co - Chair', 'Co - Chair'),
|
||||||
|
('Editor', 'Editor'),
|
||||||
|
('Head', 'Head'),
|
||||||
|
('Member', 'Member'),
|
||||||
|
('Project partner', 'Project partner'),
|
||||||
|
('SSC', 'SSC'),
|
||||||
|
)
|
||||||
id = models.AutoField(primary_key=True)
|
id = models.AutoField(primary_key=True)
|
||||||
person = models.ForeignKey(Person, models.DO_NOTHING, blank=True, null=True)
|
person = models.ForeignKey(Person, models.DO_NOTHING, blank=True, null=True)
|
||||||
resource = models.ForeignKey(Resource, models.DO_NOTHING, blank=True, null=True)
|
resource = models.ForeignKey(Resource, models.DO_NOTHING, blank=True, null=True)
|
||||||
role = models.TextField(blank=True, null=True)
|
role = models.TextField(blank=True, null=True, choices=ROLES_CHOICES)
|
||||||
p_r_role = models.ForeignKey(Role, models.DO_NOTHING, blank=True, null=True)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.person.full_name if self.person else ' -- '
|
return self.person.full_name if self.person else ' -- '
|
||||||
|
|
Loading…
Reference in a new issue