diff options
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 |
commit | d5b0c2a401a4fb133bd3486af2fa3c8dfeaddbc1 (patch) | |
tree | 98afaac11931a9d6f52987d998e63cabece10a39 /archaeological_warehouse | |
parent | 58039e9efe573b2ba08c950bf7fe0c490e21fc43 (diff) | |
download | Ishtar-d5b0c2a401a4fb133bd3486af2fa3c8dfeaddbc1.tar.bz2 Ishtar-d5b0c2a401a4fb133bd3486af2fa3c8dfeaddbc1.zip |
Prevent circular import on some instances
Diffstat (limited to 'archaeological_warehouse')
-rw-r--r-- | archaeological_warehouse/models.py | 4 |
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') |