summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-05 14:11:16 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2017-04-05 14:11:16 +0200
commitd9b7d7940a65b6c1b9ef790a119e153c3b63c091 (patch)
tree98afaac11931a9d6f52987d998e63cabece10a39
parentb21ae8fae5b267f80a9e6a82e1ea96512e1e14d6 (diff)
downloadIshtar-d9b7d7940a65b6c1b9ef790a119e153c3b63c091.tar.bz2
Ishtar-d9b7d7940a65b6c1b9ef790a119e153c3b63c091.zip
Prevent circular import on some instances
-rw-r--r--archaeological_warehouse/models.py4
1 files changed, 3 insertions, 1 deletions
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')