From 66a376e081e335cf94ecf6fd41e5fe13a5445c57 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 30 May 2018 20:26:21 +0200 Subject: Migrate images and sources to new document model (refs #4107) --- archaeological_warehouse/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'archaeological_warehouse/models.py') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 40de49d60..30c117fc2 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -27,11 +27,10 @@ from django.template.defaultfilters import slugify from django.utils.translation import ugettext_lazy as _ from ishtar_common.data_importer import post_importer_action -from ishtar_common.utils import cached_label_changed - -from ishtar_common.models import GeneralType, get_external_id, \ +from ishtar_common.models import Document, GeneralType, get_external_id, \ LightHistorizedItem, OwnPerms, Address, Person, post_save_cache, \ ImageModel, DashboardFormItem, IshtarImage, ThroughImage +from ishtar_common.utils import cached_label_changed class WarehouseType(GeneralType): @@ -63,6 +62,9 @@ class Warehouse(Address, DashboardFormItem, OwnPerms): 'WarehouseDivision', verbose_name=_("Divisions"), blank=True, through='WarehouseDivisionLink' ) + documents = models.ManyToManyField( + Document, related_name='warehouses', verbose_name=_(u"Documents"), + blank=True) images = models.ManyToManyField(IshtarImage, verbose_name=_(u"Images"), through='WarehouseImage', blank=True) external_id = models.TextField(_(u"External ID"), blank=True, null=True) -- cgit v1.2.3