diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-02 14:15:05 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-02 14:15:05 +0100 |
commit | 3c3dc92e3aef6c479b0d5f020c7dc8c4ce76e532 (patch) | |
tree | 5d4355bb39ea5de6aeaf442d07cf91fcbfa85ebd /archaeological_warehouse/views.py | |
parent | f832138b10e557fc8d4086fcdb7f1383516ccfde (diff) | |
download | Ishtar-3c3dc92e3aef6c479b0d5f020c7dc8c4ce76e532.tar.bz2 Ishtar-3c3dc92e3aef6c479b0d5f020c7dc8c4ce76e532.zip |
Sheet quick actions to add treatments from find, basket and container
Diffstat (limited to 'archaeological_warehouse/views.py')
-rw-r--r-- | archaeological_warehouse/views.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/archaeological_warehouse/views.py b/archaeological_warehouse/views.py index 0cd68dac6..83fd7f4e1 100644 --- a/archaeological_warehouse/views.py +++ b/archaeological_warehouse/views.py @@ -21,7 +21,7 @@ import json from django.core.urlresolvers import reverse from django.db.models import Q -from django.http import HttpResponse +from django.http import HttpResponse, Http404 from django.shortcuts import redirect from django.utils.translation import ugettext_lazy as _ @@ -35,6 +35,8 @@ from archaeological_warehouse.forms import WarehouseForm, ContainerForm, \ from ishtar_common.forms import FinalForm from ishtar_common.views_item import get_item, show_item, new_item +from archaeological_finds.views import treatment_add + from archaeological_warehouse.wizards import PackagingWizard, WarehouseSearch, \ WarehouseWizard, WarehouseModificationWizard, WarehouseDeletionWizard, \ ContainerSearch, ContainerWizard, ContainerModificationWizard, \ @@ -195,6 +197,15 @@ container_deletion_wizard = ContainerDeletionWizard.as_view([ label=_(u"Container deletion"), url_name='container_deletion',) + +def container_treatment_add(request, pk, current_right=None): + try: + container = models.Container.objects.get(pk=pk) + except models.Container.DoesNotExist: + raise Http404() + return treatment_add( + request, ",".join([str(f.pk) for f in container.finds.all()])) + """ warehouse_packaging_wizard = ItemSourceWizard.as_view([ ('selec-warehouse_packaging', ItemsSelection), |