Commit 094690fc authored by Christian Wygoda's avatar Christian Wygoda

Made InlineFieldList compatible with WTForms 2

parent beb637fa
...@@ -13,8 +13,10 @@ class InlineFieldList(FieldList): ...@@ -13,8 +13,10 @@ class InlineFieldList(FieldList):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(InlineFieldList, self).__init__(*args, **kwargs) super(InlineFieldList, self).__init__(*args, **kwargs)
def __call__(self, **kwargs):
# Create template # 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 # Small hack to remove separator from FormField
if isinstance(self.template, FormField): if isinstance(self.template, FormField):
...@@ -22,7 +24,6 @@ class InlineFieldList(FieldList): ...@@ -22,7 +24,6 @@ class InlineFieldList(FieldList):
self.template.process(None) self.template.process(None)
def __call__(self, **kwargs):
return self.widget(self, return self.widget(self,
template=self.template, template=self.template,
check=self.display_row_controls, check=self.display_row_controls,
......
...@@ -45,7 +45,7 @@ setup( ...@@ -45,7 +45,7 @@ setup(
platforms='any', platforms='any',
install_requires=[ install_requires=[
'Flask>=0.7', 'Flask>=0.7',
'wtforms<2.0' 'wtforms'
], ],
tests_require=[ tests_require=[
'nose>=1.0', 'nose>=1.0',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment