refactor: Make Person.discipline free text

See #33
This commit is contained in:
James Graham
2020-06-24 16:29:50 +01:00
parent 57349a6007
commit b84076ec3b
4 changed files with 67 additions and 24 deletions

View File

@@ -19,7 +19,6 @@ __all__ = [
'User',
'Organisation',
'Role',
'Discipline',
'Theme',
'Person',
]
@@ -82,19 +81,6 @@ class Role(models.Model):
return self.name
class Discipline(models.Model):
"""
Discipline within which a :class:`Person` works.
"""
name = models.CharField(max_length=255, blank=False, null=False)
#: Short code using system such as JACS 3
code = models.CharField(max_length=15, blank=True, null=False)
def __str__(self) -> str:
return self.name
class Theme(models.Model):
"""
Project theme within which a :class:`Person` works.
@@ -179,12 +165,8 @@ class Person(models.Model):
#: Job title this person holds within their organisation
job_title = models.CharField(max_length=255, blank=True, null=False)
#: Discipline within which this person works
discipline = models.ForeignKey(Discipline,
on_delete=models.PROTECT,
related_name='people',
blank=True,
null=True)
#: Discipline(s) within which this person works
disciplines = models.CharField(max_length=255, blank=True, null=True)
#: Role this person holds within the project
role = models.ForeignKey(Role,