summaryrefslogtreecommitdiff
path: root/ishtar_common/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-07-10 16:49:03 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-08-13 18:26:03 +0200
commitae76035bc7fe939996dfff4e8fc8777c5686e60b (patch)
tree6c55db881e0a2b0639035a474956cd3fd6b01404 /ishtar_common/widgets.py
parent71e370980efa9ff69cd176d6af431c99b9f080e4 (diff)
downloadIshtar-ae76035bc7fe939996dfff4e8fc8777c5686e60b.tar.bz2
Ishtar-ae76035bc7fe939996dfff4e8fc8777c5686e60b.zip
Search widget: dynamic link for bookmark save
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r--ishtar_common/widgets.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 8788920af..405b5d69e 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -479,6 +479,17 @@ if settings.SURFACE_UNIT == 'square-metre':
class SearchWidget(forms.TextInput):
template_name = 'widgets/search_input.html'
+ def __init__(self, app_name=None, model=None, attrs=None):
+ super(SearchWidget, self).__init__(attrs)
+ self.app_name = app_name
+ self.model = model
+
+ def get_context(self, name, value, attrs):
+ context = super(SearchWidget, self).get_context(name, value, attrs)
+ context['app_name'] = self.app_name
+ context['model'] = self.model
+ return context
+
class ModelFieldMixin(object):
def to_python(self, value):