This is probably related to #23. If the model contains a ListField wrapping an EmbeddedDocumentField and the latter is built from a string, then model_form fails.
The following code shows the problem
from flask.ext.mongoengine import MongoEngine
from flask.ext.mongoengine.wtf import model_form
db = MongoEngine()
class EmbedMe( db.EmbeddedDocument ):
afield = db.StringField()
class Outer( db.Document ):
embedded = db.ListField( db.EmbeddedDocumentField( EmbedMe ) )
class OuterString( db.Document ):
embedded = db.ListField( db.EmbeddedDocumentField( 'EmbedMe' ) )
print model_form( Outer )
print model_form( OuterString )
I'm sure I can provide a failing test based on aa6f13ccffee6aa29a72c3fc0278fe83d66f4981 and the snippet above, but I'm not sure I can also provide a fix.
This is probably related to #23. If the model contains a
ListField
wrapping anEmbeddedDocumentField
and the latter is built from a string, thenmodel_form
fails.The following code shows the problem
I'm sure I can provide a failing test based on aa6f13ccffee6aa29a72c3fc0278fe83d66f4981 and the snippet above, but I'm not sure I can also provide a fix.
Dear @rozza, can you help?