1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2025-06-21 01:48:21 +02:00

WEI Survey (work in progress)

This commit is contained in:
Yohann D'ANELLO
2020-04-19 20:35:49 +02:00
parent b62fa4cc6d
commit 8113c5cd61
19 changed files with 255 additions and 18 deletions

View File

@ -64,6 +64,27 @@ class Bus(models.Model):
verbose_name=_("description"),
)
information_json = models.TextField(
default="{}",
verbose_name=_("survey information"),
help_text=_("Information about the survey for new members, encoded in JSON"),
)
@property
def information(self):
"""
The information about the survey for new members are stored in a dictionary that can evolve following the years.
The dictionary is stored as a JSON string.
"""
return json.loads(self.information_json)
@information.setter
def information(self, information):
"""
Store information as a JSON string
"""
self.information_json = json.dumps(information)
def __str__(self):
return self.name