diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-04-30 15:21:25 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-06-12 08:43:58 +0200 | 
| commit | ee1551b414158380c32b3e0410ba936eb1346812 (patch) | |
| tree | 8ea4879f9ba3a6a926681b60c5fa15eb97bd941b /archaeological_operations/models.py | |
| parent | 966b18821a367e3fdcfb7639e7a7019628a937e7 (diff) | |
| download | Ishtar-ee1551b414158380c32b3e0410ba936eb1346812.tar.bz2 Ishtar-ee1551b414158380c32b3e0410ba936eb1346812.zip | |
Relation graph: add logical fields in relations
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 11 | 
1 files changed, 10 insertions, 1 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index b52477995..87ec89870 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -38,7 +38,7 @@ from ishtar_common.models import GeneralType, BaseHistorizedItem, \      SourceType, Person, Organization, Town, Dashboard, IshtarUser, ValueGetter,\      DocumentTemplate, ShortMenuItem, DashboardFormItem, GeneralRelationType,\      GeneralRecordRelations, post_delete_record_relation, OperationType, \ -    ImageModel, post_save_cache, PersonType, IshtarImage +    ImageModel, post_save_cache, PersonType, IshtarImage, get_image_path  class RemainType(GeneralType): @@ -477,6 +477,11 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,      finds_received = models.NullBooleanField(          _(u"Finds received"), blank=True, null=True) +    relation_image = models.FileField( +        _(u"Generated relation image (SVG)"), null=True, blank=True, +        upload_to=get_image_path +    ) +      # judiciary      seizure_name = models.TextField(_(u"Seizure name"), blank=True, null=True)      official_report_number = models.TextField(_(u"Official report number"), @@ -541,6 +546,10 @@ class Operation(ClosedItem, BaseHistorizedItem, ImageModel, OwnPerms,          return unicode(self)      @property +    def relation_label(self): +        return self.short_label + +    @property      def name(self):          return self.common_name | 
