diff options
| author | Étienne Loks <etienne.loks@proxience.com> | 2015-06-10 22:37:33 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@proxience.com> | 2015-06-10 22:37:33 +0200 | 
| commit | 2b61ae7f85e12d557163efdf1ee06875a0327c4a (patch) | |
| tree | 5710722a8a615cc3387943178b84dc44939cc402 /archaeological_operations/models.py | |
| parent | 032fe5ede7cc937a84b4c7477dabe007a5050e9d (diff) | |
| parent | 8f5e6d05d1bca7a02924b419ba70198e7d325af3 (diff) | |
| download | Ishtar-2b61ae7f85e12d557163efdf1ee06875a0327c4a.tar.bz2 Ishtar-2b61ae7f85e12d557163efdf1ee06875a0327c4a.zip | |
Merge branch 'stable'
Conflicts:
	archaeological_operations/models.py
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 53e572a20..20d7cf79f 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -190,11 +190,13 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,      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')) +    remains = models.ManyToManyField("RemainType", verbose_name=_(u'Remains'), +                                     null=True, blank=True )      towns = models.ManyToManyField(Town, verbose_name=_(u"Towns"))      cost = models.IntegerField(_(u"Cost (€)"),                                 blank=True, null=True) # preventive -    periods = models.ManyToManyField(Period, verbose_name=_(u"Periods")) +    periods = models.ManyToManyField(Period, verbose_name=_(u"Periods"), +                                     null=True, blank=True)      scheduled_man_days = models.IntegerField(_(u"Scheduled man-days"),                                               blank=True, null=True) # preventive      optional_man_days = models.IntegerField(_(u"Optional man-days"), @@ -203,7 +205,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,                                               blank=True, null=True) # preventive      if settings.COUNTRY == 'fr':          code_patriarche = models.IntegerField(u"Code PATRIARCHE", null=True, -                                              blank=True) +                                              blank=True, unique=True)          TABLE_COLS = ['full_code_patriarche'] + TABLE_COLS          code_dracar = models.CharField(u"Code DRACAR", max_length=10, null=True,                                         blank=True) @@ -237,7 +239,7 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,      cached_label = models.CharField(_(u"Cached name"), max_length=500,                                      null=True, blank=True)      archaeological_sites = models.ManyToManyField(ArchaeologicalSite, -                                        verbose_name=_(u"Archaeological sites")) +                 verbose_name=_(u"Archaeological sites"), null=True, blank=True)      history = HistoricalRecords()      class Meta: @@ -381,6 +383,8 @@ class Operation(BaseHistorizedItem, OwnPerms, ValueGetter, ShortMenuItem,          return u"OA" + unicode(self.code_patriarche)      def clean(self): +        if not self.operation_code: +            return          objs = self.__class__.objects.filter(year=self.year,                                               operation_code=self.operation_code)          if self.pk: | 
