diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-12 16:18:57 +0100 |
commit | f1dc9dbfed7cc90899f9975c29091a61e63fcb02 (patch) | |
tree | d7f34f347aa533855990da473b17fc35f5bb1878 /ishtar_common/widgets.py | |
parent | ce0947a6b35bb0ef3a12fe6c07efaa074317fe4b (diff) | |
download | Ishtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.tar.bz2 Ishtar-f1dc9dbfed7cc90899f9975c29091a61e63fcb02.zip |
Fix pin and unpi for administrativ acts
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 6292db202..7d9e06926 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -483,15 +483,19 @@ class CheckboxInput(forms.CheckboxInput): class SearchWidget(forms.TextInput): template_name = 'widgets/search_input.html' - def __init__(self, app_name=None, model=None, attrs=None): + def __init__(self, app_name=None, model=None, pin_model=None, attrs=None): super(SearchWidget, self).__init__(attrs) self.app_name = app_name self.model = model + if not pin_model: + pin_model = self.model + self.pin_model = pin_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 + context['pin_model'] = self.pin_model return context |