mirror of
https://github.com/Southampton-RSG/breccia-mapper.git
synced 2026-03-03 03:17:07 +00:00
feat: add view to end relationship
This commit is contained in:
@@ -124,6 +124,7 @@ class AnswerSet(models.Model):
|
||||
ordering = [
|
||||
'timestamp',
|
||||
]
|
||||
get_latest_by = 'timestamp'
|
||||
|
||||
#: Entity to which this answer set belongs
|
||||
#: This foreign key must be added to each concrete subclass
|
||||
@@ -145,6 +146,10 @@ class AnswerSet(models.Model):
|
||||
null=True,
|
||||
editable=False)
|
||||
|
||||
@property
|
||||
def is_current(self) -> bool:
|
||||
return self.replaced_timestamp is None
|
||||
|
||||
def as_dict(self, answers: typing.Optional[typing.Dict[str, typing.Any]] = None):
|
||||
"""Get the answers from this set as a dictionary for use in Form.initial."""
|
||||
if answers is None:
|
||||
|
||||
Reference in New Issue
Block a user