Add signal question_form_fields

This commit is contained in:
Raphael Michel
2017-07-02 19:45:26 +02:00
parent 45c17ba949
commit 1fc3307d22
11 changed files with 154 additions and 7 deletions

View File

@@ -405,6 +405,8 @@ class AbstractPosition(models.Model):
:type attendee_email: str
:param voucher: A voucher that has been applied to this sale
:type voucher: Voucher
:param meta_info: Additional meta information on the position, JSON-encoded.
:type meta_info: str
"""
item = models.ForeignKey(
Item,
@@ -438,10 +440,21 @@ class AbstractPosition(models.Model):
addon_to = models.ForeignKey(
'self', null=True, blank=True, on_delete=models.CASCADE, related_name='addons'
)
meta_info = models.TextField(
verbose_name=_("Meta information"),
null=True, blank=True
)
class Meta:
abstract = True
@property
def meta_info_data(self):
if self.meta_info:
return json.loads(self.meta_info)
else:
return {}
def cache_answers(self):
"""
Creates two properties on the object.