diff options
Diffstat (limited to 'ishtar_common/models.py')
| -rw-r--r-- | ishtar_common/models.py | 13 | 
1 files changed, 13 insertions, 0 deletions
| diff --git a/ishtar_common/models.py b/ishtar_common/models.py index f23cab926..483e15786 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1664,6 +1664,15 @@ class Organization(Address, Merge, OwnPerms, ValueGetter, MainItem):                    if getattr(self, attr)]          return slugify("-".join(values)) +    @classmethod +    @pre_importer_action +    def import_get_publisher_type(cls, context, value): +        if context["name"]: +            q = OrganizationType.objects.filter(txt_idx='publisher') +            if not q.count(): +                return +            context["organization_type"] = q.all()[0] +  post_save.connect(cached_label_changed, sender=Organization) @@ -3256,6 +3265,10 @@ class Document(BaseHistorizedItem, QRCodeItem, OwnPerms, ImageModel,              cid = 0          return cid + 1 +    @classmethod +    def get_import_defaults(cls): +        return {"index": cls.get_next_index()} +      def set_index(self):          if self.index:              return | 
