diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-18 18:34:43 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-18 18:34:43 +0100 |
commit | f42ea0f49a4d5c5a6cb15758d2bc8edaacc49ec3 (patch) | |
tree | 617d32c1aaa8c85a4782aecfa64d075f598af0dc /ishtar_common | |
parent | f2274d391af31cd620465f4424e4510e075562cd (diff) | |
download | Ishtar-f42ea0f49a4d5c5a6cb15758d2bc8edaacc49ec3.tar.bz2 Ishtar-f42ea0f49a4d5c5a6cb15758d2bc8edaacc49ec3.zip |
Containers / Warehouse: actions, sheets and fixes.
Diffstat (limited to 'ishtar_common')
-rw-r--r-- | ishtar_common/templatetags/window_tables.py | 3 | ||||
-rw-r--r-- | ishtar_common/wizards.py | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py index 377b6e435..e9f628ab6 100644 --- a/ishtar_common/templatetags/window_tables.py +++ b/ishtar_common/templatetags/window_tables.py @@ -18,6 +18,7 @@ from archaeological_context_records.models import ContextRecord, \ ContextRecordSource, RecordRelations as CRRecordRelations from archaeological_finds.models import Find, FindSource, \ FindUpstreamTreatments, FindDownstreamTreatments, FindTreatments +from archaeological_warehouse.models import Container register = template.Library() @@ -55,6 +56,8 @@ ASSOCIATED_MODELS['finds_downstreamtreatments'] = ( FindDownstreamTreatments, 'get-downstreamtreatment', '') ASSOCIATED_MODELS['treatments'] = ( FindTreatments, 'get-treatment', '') +ASSOCIATED_MODELS['containers'] = ( + Container, 'get-container', '') @register.simple_tag(takes_context=True) diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 2fbe30e0e..6e5216c6a 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -647,8 +647,8 @@ class Wizard(NamedUrlWizardView): model.RELATIVE_MODELS: value[model.RELATIVE_MODELS[ self.get_saved_model()]] = obj - value = model.objects.create(**value) - value.save() + value, created = model.objects.get_or_create(**value) + value.save() # force post_save # check that an item is not add multiple times (forged forms) if value not in related_model.all() and\ hasattr(related_model, 'add'): |