diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-02-15 12:25:13 +0100 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-02-15 12:25:13 +0100 |
| commit | ee0c65f8b5cee7dbfbe65099a65f666267daa809 (patch) | |
| tree | 22878e182bd23b3b2102eeffe215a3dab5618b07 /archaeological_finds/models_finds.py | |
| parent | 42c6c2166d0e2845c28c776b404072d0b226664d (diff) | |
| download | Ishtar-ee0c65f8b5cee7dbfbe65099a65f666267daa809.tar.bz2 Ishtar-ee0c65f8b5cee7dbfbe65099a65f666267daa809.zip | |
Finds - communicability: add new in model, admin and sheet (refs #3754)
Diffstat (limited to 'archaeological_finds/models_finds.py')
| -rw-r--r-- | archaeological_finds/models_finds.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index e1c866f9d..34e3c4f87 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -89,6 +89,8 @@ class TreatmentType(GeneralType): verbose_name = _(u"Treatment type") verbose_name_plural = _(u"Treatment types") ordering = ('label',) + + post_save.connect(post_save_cache, sender=TreatmentType) post_delete.connect(post_save_cache, sender=TreatmentType) @@ -171,6 +173,17 @@ post_save.connect(post_save_cache, sender=TreatmentEmergencyType) post_delete.connect(post_save_cache, sender=TreatmentEmergencyType) +class CommunicabilityType(HierarchicalType): + class Meta: + verbose_name = _(u"Communicability type") + verbose_name_plural = _(u"Communicability types") + ordering = ('parent__label', 'label',) + + +post_save.connect(post_save_cache, sender=CommunicabilityType) +post_delete.connect(post_save_cache, sender=CommunicabilityType) + + class BFBulkView(object): CREATE_SQL = """ CREATE VIEW basefind_cached_bulk_update @@ -699,6 +712,9 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, ImageModel, remarkabilities = models.ManyToManyField( RemarkabilityType, verbose_name=_(u"Remarkability"), related_name='find', blank=True) + communicabilities = models.ManyToManyField( + CommunicabilityType, verbose_name=_(u"Communicability"), + related_name='find', blank=True) min_number_of_individuals = models.IntegerField( _(u"Minimum number of individuals (MNI)"), blank=True, null=True) length = models.FloatField(_(u"Length (cm)"), blank=True, null=True) |
