konova/intervention/models/legal.py
mpeltriaux d78afbfb5c Refactoring
* splits intervention/models.py into subpackage
2021-11-15 17:19:06 +01:00

47 lines
1.3 KiB
Python

"""
Author: Michel Peltriaux
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
Contact: michel.peltriaux@sgdnord.rlp.de
Created on: 15.11.21
"""
from django.db import models
from codelist.models import KonovaCode
from codelist.settings import CODELIST_LAW_ID, CODELIST_PROCESS_TYPE_ID
from konova.models import UuidModel
class Legal(UuidModel):
"""
Holds intervention legal data such as important dates, laws or responsible handler
"""
# Refers to "zugelassen am"
registration_date = models.DateField(null=True, blank=True, help_text="Refers to 'Zugelassen am'")
# Refers to "Bestandskraft am"
binding_date = models.DateField(null=True, blank=True, help_text="Refers to 'Bestandskraft am'")
process_type = models.ForeignKey(
KonovaCode,
on_delete=models.SET_NULL,
null=True,
related_name="+",
blank=True,
limit_choices_to={
"code_lists__in": [CODELIST_PROCESS_TYPE_ID],
"is_selectable": True,
"is_archived": False,
}
)
laws = models.ManyToManyField(
KonovaCode,
blank=True,
limit_choices_to={
"code_lists__in": [CODELIST_LAW_ID],
"is_selectable": True,
"is_archived": False,
}
)