def __init__ ( self , form_post_data = None , * args , * * kwargs ) : kwargs . update ( { 'form_post_data' : form_post_data } ) super ( MongoModelForm , self ) . __init__ ( * args , * * kwargs )
django set form data in python
Overriding init so we can set the post vars like a normal form and generate the form the same way Django does .
def __init__(self, form_post_data=None, *args, **kwargs):
        """
        Overriding init so we can set the post vars like a normal form and generate
        the form the same way Django does.
        """
        kwargs.update({'form_post_data': form_post_data})
        super(MongoModelForm, self).__init__(*args, **kwargs)