Skip to content

Fix for WTForms 2.* #3

@macfire

Description

@macfire

I'm not sure if you are still using this project. I'm glad to find it.

A minor change is needed to work with WTForms 2.1
Not sure if this is the best solution, but is working with minimal testing:

I was receiving the following error in WTForms core.py

if _meta is not None:
     self.meta = _meta
elif _form is not None:
     self.meta = _form.meta
else:
raise TypeError("Must provide one of _form or _meta")

So I passed the form to convert_formfield()

#133
def convert_formfield(self, name, field, json_schema, forms_seen, path, form):
    # 162
    subfield = field.unbound_field.bind(getattr(field, '_obj', form), name)
    # 163
    target_def['items'] = self.convert_formfield(name, subfield, json_schema, forms_seen, path, form)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions