Skip to content

Commit

Permalink
Made InlineFieldList compatible with WTForms 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Wygoda committed Nov 3, 2014
1 parent beb637f commit 094690f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions flask_admin/model/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ class InlineFieldList(FieldList):
def __init__(self, *args, **kwargs):
super(InlineFieldList, self).__init__(*args, **kwargs)

def __call__(self, **kwargs):
# Create template
self.template = self.unbound_field.bind(form=None, name='')
self.template = self.unbound_field.bind(form=None, name='',
_meta=self.meta)

# Small hack to remove separator from FormField
if isinstance(self.template, FormField):
self.template.separator = ''

self.template.process(None)

def __call__(self, **kwargs):
return self.widget(self,
template=self.template,
check=self.display_row_controls,
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def grep(attrname):
platforms='any',
install_requires=[
'Flask>=0.7',
'wtforms<2.0'
'wtforms'
],
tests_require=[
'nose>=1.0',
Expand Down

0 comments on commit 094690f

Please sign in to comment.