From 6c47b6b3bc23aadc674175f140091f46aa5f3868 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 14 Dec 2015 22:02:33 +0100 Subject: Force own filters for context records and finds --- archaeological_finds/urls.py | 6 ++++++ archaeological_finds/wizards.py | 6 ++++++ 2 files changed, 12 insertions(+) (limited to 'archaeological_finds') diff --git a/archaeological_finds/urls.py b/archaeological_finds/urls.py index 29f502e15..7a01f952b 100644 --- a/archaeological_finds/urls.py +++ b/archaeological_finds/urls.py @@ -62,10 +62,16 @@ urlpatterns += patterns( name='autocomplete-preservationtype'), url(r'autocomplete-integritytype/$', 'autocomplete_integritytype', name='autocomplete-integritytype'), + url(r'get-find/own/(?P.+)?$', 'get_find', + name='get-own-find', kwargs={'force_own': True}), url(r'get-find/(?P.+)?$', 'get_find', name='get-find'), + url(r'get-find-for-ope/own/(?P.+)?$', 'get_find_for_ope', + name='get-own-find-for-ope', kwargs={'force_own': True}), url(r'get-find-for-ope/(?P.+)?$', 'get_find_for_ope', name='get-find-for-ope'), + url(r'get-find-full/own/(?P.+)?$', 'get_find', + name='get-own-find-full', kwargs={'full': True, 'force_own': True}), url(r'get-find-full/(?P.+)?$', 'get_find', name='get-find-full', kwargs={'full': True}), url(r'get-findsource/(?P.+)?$', diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index 0a7ddc284..c586cd809 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -71,19 +71,25 @@ class FindWizard(Wizard): dct['base_finds__context_record'] = dct.pop('pk') return dct + class FindModificationWizard(FindWizard): modification = True + filter_owns = {'selec-find_modification': ['pk']} + class TreatmentWizard(Wizard): model = models.Treatment + class FindSourceWizard(SourceWizard): model = models.FindSource + class FindSourceDeletionWizard(DeletionWizard): model = models.FindSource fields = ['item', 'title', 'source_type', 'authors',] + class TreatmentSourceWizard(SourceWizard): model = models.TreatmentSource -- cgit v1.2.3