diff options
Diffstat (limited to 'archaeological_files/models.py')
-rw-r--r-- | archaeological_files/models.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py index c5e9399c4..74ce3a0d6 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -29,6 +29,8 @@ from django.core.validators import MinValueValidator, MaxValueValidator from django.db.models import Q, Count, Sum, Max from django.db.models.signals import post_save, m2m_changed, post_delete from django.urls import reverse + +from ishtar_common.models_common import OrderedHierarchicalType from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy, get_current_profile from ishtar_common.utils import ( @@ -353,6 +355,30 @@ post_save.connect(post_save_cache, sender=AgreementType) post_delete.connect(post_save_cache, sender=AgreementType) +class MonitoringJustificationType(OrderedHierarchicalType): + class Meta: + verbose_name = _("Monitoring justification type") + verbose_name_plural = _("Monitoring justification types") + ordering = ("label",) + ADMIN_SECTION = _("Preventive") + + +post_save.connect(post_save_cache, sender=MonitoringJustificationType) +post_delete.connect(post_save_cache, sender=MonitoringJustificationType) + + +class DevelopmentType(OrderedHierarchicalType): + class Meta: + verbose_name = _("Development type") + verbose_name_plural = _("Development types") + ordering = ("label",) + ADMIN_SECTION = _("Preventive") + + +post_save.connect(post_save_cache, sender=DevelopmentType) +post_delete.connect(post_save_cache, sender=DevelopmentType) + + class OperationTypeForRoyalties(GeneralType): increase_coefficient = models.FloatField( _("Increase coefficient"), default=1) @@ -719,6 +745,14 @@ class File( # <-- research archaeology # --> preventive detail + development_type = models.ForeignKey( + DevelopmentType, verbose_name=_("Development type"), blank=True, null=True, + on_delete=models.SET_NULL + ) + monitoring_justification = models.ForeignKey( + MonitoringJustificationType, verbose_name=_("Monitoring justification"), blank=True, null=True, + on_delete=models.SET_NULL + ) price_agreement = models.ForeignKey( PriceAgreement, verbose_name=_("Price agreement"), blank=True, null=True, on_delete=models.SET_NULL |