diff options
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 54e06b05c..855d7c8e4 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -35,8 +35,6 @@ from ishtar_common.models import GeneralType, BaseHistorizedItem, \ Person, Organization, Town, Dashboard, IshtarUser, ValueGetter, \ DocumentTemplate FILES_AVAILABLE = 'archaeological_files' in settings.INSTALLED_APPS -if FILES_AVAILABLE: - from archaeological_files.models import File class OperationType(GeneralType): preventive = models.BooleanField(_(u"Is preventive"), default=True) @@ -122,21 +120,23 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter): operation_code = models.IntegerField(_(u"Operation code"), null=True, blank=True) if FILES_AVAILABLE: - associated_file = models.ForeignKey(File, related_name='operations', - verbose_name=_(u"File"), blank=True, null=True) + associated_file = models.ForeignKey('archaeological_files.File', + related_name='operations', verbose_name=_(u"File"), + blank=True, null=True) operation_type = models.ForeignKey(OperationType, related_name='+', verbose_name=_(u"Operation type")) surface = models.IntegerField(_(u"Surface (m²)"), blank=True, null=True) remains = models.ManyToManyField("RemainType", verbose_name=_(u'Remains')) towns = models.ManyToManyField(Town, verbose_name=_(u"Towns")) - cost = models.IntegerField(_(u"Cost (€)"), blank=True, null=True) + cost = models.IntegerField(_(u"Cost (€)"), + blank=True, null=True) # preventive periods = models.ManyToManyField(Period, verbose_name=_(u"Periods")) scheduled_man_days = models.IntegerField(_(u"Scheduled man-days"), - blank=True, null=True) + blank=True, null=True) # preventive optional_man_days = models.IntegerField(_(u"Optional man-days"), - blank=True, null=True) + blank=True, null=True) # preventive effective_man_days = models.IntegerField(_(u"Effective man-days"), - blank=True, null=True) + blank=True, null=True) # preventive if settings.COUNTRY == 'fr': code_patriarche = models.IntegerField(u"Code PATRIARCHE", null=True, blank=True) @@ -144,15 +144,18 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter): code_dracar = models.CharField(u"Code DRACAR", max_length=10, null=True, blank=True) fnap_financing = models.FloatField(u"Financement FNAP (%)", - blank=True, null=True) + blank=True, null=True) # preventive fnap_cost = models.IntegerField(u"Financement FNAP (€)", - blank=True, null=True) + blank=True, null=True) # preventive zoning_prescription = models.NullBooleanField( - _(u"Prescription on zoning"), blank=True, null=True) + _(u"Prescription on zoning"), + blank=True, null=True) # preventive diag large_area_prescription = models.NullBooleanField( - _(u"Prescription on large area"), blank=True, null=True) + _(u"Prescription on large area"), + blank=True, null=True) # preventive diag geoarchaeological_context_prescription = models.NullBooleanField( - _(u"Prescription on geoarchaeological context"), blank=True, null=True) + _(u"Prescription on geoarchaeological context"), + blank=True, null=True) # preventive diag cira_rapporteur = models.ForeignKey(Person, related_name='+', null=True, blank=True, verbose_name=u"Rapporteur CIRA") negative_result = models.NullBooleanField( @@ -435,7 +438,8 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): operation = models.ForeignKey(Operation, blank=True, null=True, related_name='administrative_act', verbose_name=_(u"Operation")) if FILES_AVAILABLE: - associated_file = models.ForeignKey(File, blank=True, null=True, + associated_file = models.ForeignKey('archaeological_files.File', + blank=True, null=True, related_name='administrative_act', verbose_name=_(u"Archaelogical file")) signature_date = models.DateField(_(u"Signature date"), blank=True, @@ -546,8 +550,9 @@ class AdministrativeAct(BaseHistorizedItem, OwnPerms, ValueGetter): class Parcel(LightHistorizedItem): if FILES_AVAILABLE: - associated_file = models.ForeignKey(File, related_name='parcels', - blank=True, null=True, verbose_name=_(u"File")) + associated_file = models.ForeignKey('archaeological_files.File', + related_name='parcels', verbose_name=_(u"File"), + blank=True, null=True) operation = models.ForeignKey(Operation, related_name='parcels', blank=True, null=True, verbose_name=_(u"Operation")) year = models.IntegerField(_(u"Year"), blank=True, null=True) |