summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-06-02 17:27:03 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-06-02 17:27:03 +0200
commit51ab900d3a61c719923390be1fb980019ac1da56 (patch)
tree9154b617bfa283b915cde3686138b5dfc7f15208 /ishtar_common
parent7868245668607ab9fb618011e4880f15ec1ef7de (diff)
downloadIshtar-51ab900d3a61c719923390be1fb980019ac1da56.tar.bz2
Ishtar-51ab900d3a61c719923390be1fb980019ac1da56.zip
Add full export of operation's sources
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/forms.py7
-rw-r--r--ishtar_common/templatetags/window_tables.py4
2 files changed, 7 insertions, 4 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index a5abdddcd..5e0d14eb8 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -128,7 +128,7 @@ class ClosingDateFormSelection(forms.Form):
def get_form_selection(
class_name, label, key, model, base_form, get_url,
not_selected_error=_(u"You should select an item."), new=False,
- new_message=_(u"Add a new item")):
+ new_message=_(u"Add a new item"), get_full_url=None):
"""
Generate a class selection form
class_name -- name of the class
@@ -145,11 +145,14 @@ def get_form_selection(
'form_label': label,
'associated_models': {key: model},
'currents': {key: model}}
+ widget_kwargs = {"new": new, "new_message": new_message}
+ if get_full_url:
+ widget_kwargs['source_full'] = reverse_lazy(get_full_url)
attrs[key] = forms.IntegerField(
label="", required=False,
validators=[models.valid_id(model)],
widget=widgets.JQueryJqGrid(reverse_lazy(get_url), base_form, model,
- new=new, new_message=new_message))
+ **widget_kwargs))
def clean(self):
cleaned_data = self.cleaned_data
diff --git a/ishtar_common/templatetags/window_tables.py b/ishtar_common/templatetags/window_tables.py
index 8be4e5559..6bed38201 100644
--- a/ishtar_common/templatetags/window_tables.py
+++ b/ishtar_common/templatetags/window_tables.py
@@ -27,8 +27,8 @@ def table_document(caption, data):
ASSOCIATED_MODELS = {}
ASSOCIATED_MODELS['files'] = (File, 'get-file', '')
-ASSOCIATED_MODELS['operation_docs'] = (OperationSource,
- 'get-operationsource', '')
+ASSOCIATED_MODELS['operation_docs'] = (
+ OperationSource, 'get-operationsource', 'get-operationsource-full')
ASSOCIATED_MODELS['operations'] = (Operation, 'get-operation', '')
ASSOCIATED_MODELS['context_records'] = (ContextRecord, 'get-contextrecord',
'get-contextrecord-full')