From d9b7d7940a65b6c1b9ef790a119e153c3b63c091 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 5 Apr 2017 14:11:16 +0200 Subject: Prevent circular import on some instances --- archaeological_warehouse/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'archaeological_warehouse/models.py') diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index 2851e1df0..96814339c 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -31,7 +31,6 @@ from ishtar_common.utils import cached_label_changed from ishtar_common.models import GeneralType, get_external_id, \ LightHistorizedItem, OwnPerms, Address, Person, post_save_cache, \ ImageModel, DashboardFormItem -from archaeological_finds.models import Find class WarehouseType(GeneralType): @@ -87,10 +86,12 @@ class Warehouse(Address, DashboardFormItem, OwnPerms): @property def number_of_finds(self): + from archaeological_finds.models import Find return Find.objects.filter(container__responsible=self).count() @property def number_of_finds_hosted(self): + from archaeological_finds.models import Find return Find.objects.filter(container__location=self).count() @property @@ -161,6 +162,7 @@ class Warehouse(Address, DashboardFormItem, OwnPerms): return final_res def _number_of_finds_by_place(self): + from archaeological_finds.models import Find return self._number_of_items_by_place( Find, division_key='container__division') -- cgit v1.2.3