summaryrefslogtreecommitdiff
path: root/ishtar_common/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 11:24:39 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2013-07-17 11:24:39 +0200
commit19fcad448d6b0f748cb9585a41f748aea62ab1f3 (patch)
treea59cf4f022e1a127e18baade9a7a82c8852b5d7e /ishtar_common/widgets.py
parent21c052fa05d9904bc38b34dab15a1ba2d267db88 (diff)
downloadIshtar-19fcad448d6b0f748cb9585a41f748aea62ab1f3.tar.bz2
Ishtar-19fcad448d6b0f748cb9585a41f748aea62ab1f3.zip
Fix cached forms that doesn't allow modeltypes update
Don't instanciate the form passed to the widget
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r--ishtar_common/widgets.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index af638aba7..d19b73b94 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -207,7 +207,8 @@ class JQueryJqGrid(forms.RadioSelect):
def render(self, name, value=None, attrs=None):
t = loader.get_template('blocks/form_snippet.html')
- rendered = t.render(Context({'form':self.form}))
+ form = self.form()
+ rendered = t.render(Context({'form':form}))
rendered += u"\n</table>\n"\
u"<button id='search_%s' class='submit'>%s</button>" % (
name, unicode(_("Search")))
@@ -219,8 +220,8 @@ class JQueryJqGrid(forms.RadioSelect):
rendered += "\n<h4>%s</h4>\n" % unicode(_("Search and select an item"))
extra_cols = []
col_names, col_idx = [], []
- for k in self.form.get_input_ids():
- #field = self.form.fields[k]
+ for k in form.get_input_ids():
+ #field = form.fields[k]
col_idx.append(u'"%s"' % k)
for field_name in getattr(self.associated_model, self.table_cols):
field = self.associated_model