diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-12-14 22:02:33 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-12-14 22:02:33 +0100 |
commit | e8622c5d615bb39097cb4065976f53f2949976ae (patch) | |
tree | 51f9389ebd5b92cf477c169e9266201a8d90cbce | |
parent | 9b6160b263f737271a0f1aad44b02bca0a70b878 (diff) | |
download | Ishtar-e8622c5d615bb39097cb4065976f53f2949976ae.tar.bz2 Ishtar-e8622c5d615bb39097cb4065976f53f2949976ae.zip |
Force own filters for context records and finds
-rw-r--r-- | archaeological_context_records/urls.py | 8 | ||||
-rw-r--r-- | archaeological_context_records/wizards.py | 2 | ||||
-rw-r--r-- | archaeological_finds/urls.py | 6 | ||||
-rw-r--r-- | archaeological_finds/wizards.py | 6 |
4 files changed, 22 insertions, 0 deletions
diff --git a/archaeological_context_records/urls.py b/archaeological_context_records/urls.py index 7487c39c5..6ffc2f194 100644 --- a/archaeological_context_records/urls.py +++ b/archaeological_context_records/urls.py @@ -64,11 +64,19 @@ urlpatterns += patterns( 'show_contextrecord', name='show-historized-contextrecord'), url(r'revert-contextrecord/(?P<pk>.+)/(?P<date>.+)$', 'revert_contextrecord', name='revert-contextrecord'), + url(r'get-contextrecord/own/(?P<type>.+)?$', 'get_contextrecord', + name='get-own-contextrecord', kwargs={'force_own': True}), url(r'get-contextrecord/(?P<type>.+)?$', 'get_contextrecord', name='get-contextrecord'), + url(r'get-contextrecord-for-ope/own/(?P<type>.+)?$', + 'get_contextrecord_for_ope', + name='get-own-contextrecord-for-ope', kwargs={'force_own': True}), url(r'get-contextrecord-for-ope/(?P<type>.+)?$', 'get_contextrecord_for_ope', name='get-contextrecord-for-ope'), + url(r'get-contextrecord-full/own/(?P<type>.+)?$', + 'get_contextrecord', name='get-own-contextrecord-full', + kwargs={'full': True, 'force_own': True}), url(r'get-contextrecord-full/(?P<type>.+)?$', 'get_contextrecord', name='get-contextrecord-full', kwargs={'full': True}), diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py index a51809d32..99c666e89 100644 --- a/archaeological_context_records/wizards.py +++ b/archaeological_context_records/wizards.py @@ -94,6 +94,7 @@ class RecordWizard(Wizard): class RecordModifWizard(RecordWizard): modification = True model = models.ContextRecord + filter_owns = {'selec-record_modification': ['pk']} class RecordDeletionWizard(DeletionWizard): @@ -102,6 +103,7 @@ class RecordDeletionWizard(DeletionWizard): 'depth', 'location', 'datings', 'units', 'has_furniture', 'filling', 'interpretation', 'taq', 'taq_estimated', 'tpq', 'tpq_estimated'] + filter_owns = {'selec-record_deletion': ['pk']} class RecordSourceWizard(SourceWizard): 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<type>.+)?$', 'get_find', + name='get-own-find', kwargs={'force_own': True}), url(r'get-find/(?P<type>.+)?$', 'get_find', name='get-find'), + url(r'get-find-for-ope/own/(?P<type>.+)?$', 'get_find_for_ope', + name='get-own-find-for-ope', kwargs={'force_own': True}), url(r'get-find-for-ope/(?P<type>.+)?$', 'get_find_for_ope', name='get-find-for-ope'), + url(r'get-find-full/own/(?P<type>.+)?$', 'get_find', + name='get-own-find-full', kwargs={'full': True, 'force_own': True}), url(r'get-find-full/(?P<type>.+)?$', 'get_find', name='get-find-full', kwargs={'full': True}), url(r'get-findsource/(?P<type>.+)?$', 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 |