diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2016-01-10 15:35:51 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2016-01-10 15:35:51 +0100 | 
| commit | 11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6 (patch) | |
| tree | 8d8e7c09faf179b2fed07878d1cf450a245a78d0 /archaeological_operations/models.py | |
| parent | 19fcd922361b045894c0eeb56e095d785299909e (diff) | |
| parent | 2c063aace94e5a9f3b5dc596e4a502ef062db059 (diff) | |
| download | Ishtar-11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6.tar.bz2 Ishtar-11d7e76203e13a6d4c2a0c9aa29bd2d1dd86f5b6.zip | |
Merge branch 'master' into master-land-planner-2999
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 21 | 
1 files changed, 20 insertions, 1 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index a1cd43b58..795c1a805 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -62,6 +62,18 @@ class Period(GeneralType):          return self.label +class ReportState(GeneralType): +    order = models.IntegerField(_(u"Order")) + +    class Meta: +        verbose_name = _(u"Report state") +        verbose_name_plural = _(u"Report states") +        ordering = ('order',) + +    def __unicode__(self): +        return self.label + +  class ArchaeologicalSite(BaseHistorizedItem):      reference = models.CharField(_(u"Reference"), max_length=20, unique=True)      name = models.CharField(_(u"Name"), max_length=200, @@ -122,6 +134,7 @@ QUALITY = (('ND', _(u"Not documented")),  class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,                  DashboardFormItem):      QUALITY_DICT = dict(QUALITY) +    SHOW_URL = 'show-operation'      TABLE_COLS = ['year_index', 'operation_type', 'remains', 'towns',                    'start_date', 'excavation_end_date']      if FILES_AVAILABLE: @@ -172,6 +185,9 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,      # preventive      effective_man_days = models.IntegerField(_(u"Effective man-days"),                                               blank=True, null=True) +    report_processing = models.ForeignKey( +        ReportState, verbose_name=_(u"Report processing"), +        blank=True, null=True)      if settings.COUNTRY == 'fr':          code_patriarche = models.IntegerField(u"Code PATRIARCHE", null=True,                                                blank=True, unique=True) @@ -257,7 +273,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,      @property      def short_label(self):          if settings.COUNTRY == 'fr': -            return self.code_patriarche +            return self.reference          return unicode(self)      @property @@ -457,6 +473,7 @@ class RelationType(GeneralRelationType):  class RecordRelations(GeneralRecordRelations, models.Model): +    MAIN_ATTR = 'left_record'      left_record = models.ForeignKey(Operation,                                      related_name='right_relations')      right_record = models.ForeignKey(Operation, @@ -466,6 +483,7 @@ class RecordRelations(GeneralRecordRelations, models.Model):      class Meta:          verbose_name = _(u"Operation record relation")          verbose_name_plural = _(u"Operation record relations") +        ordering = ('left_record', 'relation_type')  post_delete.connect(post_delete_record_relation, sender=RecordRelations) @@ -505,6 +523,7 @@ class OperationSource(Source):                                  null=True)      TABLE_COLS = ['operation.year', 'operation.operation_code'] + \          Source.TABLE_COLS +    SHOW_URL = 'show-operationsource'      @property      def owner(self): | 
