

from flask.ext.mongoengine.wtf import model_form

from paveldedik.models import User, Post


post_args = {
    'title': {'label': u'Title'},
    'leading': {'label': u'Leading'},
    'content': {'label': u'Content'},
}


UserForm = model_form(User)

PostForm = model_form(Post, field_args=post_args)



from flask.ext.mongoengine.wtf import model_form

from paveldedik.models import User, Post


#: Model the user form. Additional field arguments can be included using
#: the key-word argument ``field_args``. For more information about using
#: WTForms follow `this link<http://flask.pocoo.org/snippets/60/>`_.
UserForm = model_form(User)

#: Model the post form. The attribute ``post_is`` must be excluded so that
#: the field is not required during form validation and it is not rewritten
#: when calling `populate_obj` on the :class:`models.Post` instance.
PostForm = model_form(Post, exclude=['post_id'])

Exclude post_id from the wtform.
Exclude post_id from the wtform.

  
  
  from flask.ext.mongoengine.wtf import model_form
  
  from paveldedik.models import User, Post
  
  
+ #: Model the user form. Additional field arguments can be included using
+ #: the key-word argument ``field_args``. For more information about using
+ #: WTForms follow `this link<http://flask.pocoo.org/snippets/60/>`_.
- post_args = {
-     'title': {'label': u'Title'},
-     'leading': {'label': u'Leading'},
-     'content': {'label': u'Content'},
- }
- 
- 
  UserForm = model_form(User)
  
+ #: Model the post form. The attribute ``post_is`` must be excluded so that
+ #: the field is not required during form validation and it is not rewritten
+ #: when calling `populate_obj` on the :class:`models.Post` instance.
- PostForm = model_form(Post, field_args=post_args)
+ PostForm = model_form(Post, exclude=['post_id'])
  
Exclude post_id from the wtform.
## Code Before:


from flask.ext.mongoengine.wtf import model_form

from paveldedik.models import User, Post


post_args = {
    'title': {'label': u'Title'},
    'leading': {'label': u'Leading'},
    'content': {'label': u'Content'},
}


UserForm = model_form(User)

PostForm = model_form(Post, field_args=post_args)

## Instruction:
Exclude post_id from the wtform.
## Code After:


from flask.ext.mongoengine.wtf import model_form

from paveldedik.models import User, Post


#: Model the user form. Additional field arguments can be included using
#: the key-word argument ``field_args``. For more information about using
#: WTForms follow `this link<http://flask.pocoo.org/snippets/60/>`_.
UserForm = model_form(User)

#: Model the post form. The attribute ``post_is`` must be excluded so that
#: the field is not required during form validation and it is not rewritten
#: when calling `populate_obj` on the :class:`models.Post` instance.
PostForm = model_form(Post, exclude=['post_id'])
