#20 Multiple laws

* refactors law field from ForeignKey to ManyToManyField to support multiple laws being added to one LegalData object
* added funding data to EMA detail view
This commit is contained in:
mipel
2021-09-20 13:33:07 +02:00
parent 43075088de
commit 8a2bbb1fc2
4 changed files with 22 additions and 13 deletions
+2 -10
View File
@@ -136,6 +136,7 @@ class RevocationDocument(AbstractDocument):
# Folder seems to be missing already
pass
class LegalData(UuidModel):
"""
Holds intervention legal data such as important dates, laws or responsible handler
@@ -158,11 +159,9 @@ class LegalData(UuidModel):
"is_archived": False,
}
)
law = models.ForeignKey(
laws = models.ManyToManyField(
KonovaCode,
on_delete=models.SET_NULL,
null=True,
related_name="+",
blank=True,
limit_choices_to={
"code_lists__in": [CODELIST_LAW_ID],
@@ -173,13 +172,6 @@ class LegalData(UuidModel):
revocation = models.OneToOneField(Revocation, null=True, blank=True, help_text="Refers to 'Widerspruch am'", on_delete=models.SET_NULL)
def __str__(self):
return "{} | {} | {}".format(
self.process_type,
self.law,
self.id
)
class Intervention(BaseObject):
"""