refactor: move disciplines and orgs to free text

Resolves #102
This commit is contained in:
James Graham
2021-03-16 11:54:34 +00:00
parent 583a49fdd3
commit 98e9148998
4 changed files with 92 additions and 1 deletions

View File

@@ -169,6 +169,17 @@ class PersonAnswerSet(AnswerSet):
blank=True,
null=False)
disciplinary_background = models.CharField(
help_text='Research discipline(s) you feel most affiliated with',
max_length=255,
blank=True,
null=False)
#: Organisations worked with which aren't in the Organisations list
external_organisations = models.CharField(max_length=1023,
blank=True,
null=False)
#: Latitude for displaying location on a map
latitude = models.FloatField(blank=True, null=True)
@@ -203,7 +214,8 @@ class PersonAnswerSet(AnswerSet):
answers = {
# Foreign key fields have _id at end in model _meta but don't in forms
field.attname.rstrip('_id'): field_value_repr(field)
# str.rstrip strips a set of characters, not a suffix, so doesn't work here
field.attname.rsplit('_id')[0]: field_value_repr(field)
for field in self._meta.get_fields()
if field.attname not in exclude_fields
}