Module ImportFrom alias identifier ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad For NameStore AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr body If BoolOpOr CompareNotIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr CompareEq Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad body Assign NameStore NameLoad If AttributeLoad AttributeLoad NameLoad attr attr body TryExcept body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Str handlers ExceptHandler type TupleLoad NameLoad NameLoad body Pass Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr NameLoad orelse If CompareNotEq AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list
N/A django.forms ModelForm DjangoModelForm django.core.exceptions ObjectDoesNotExist django.db.models.fields NOT_PROVIDED ModelForm N/A DjangoModelForm N/A N/A 
    Allows a model form to validate properly with default attributes missing.

    Django model forms expect all attributes for a given model to be present
    in a request. Since a typical request comes from an HTML form and the HTML
    for that form is typically generated by the form object (which sets all
    of the HTML form values to the defaults of the model), this is usually not
    an issue. However, with RESTful requests, we cannot assume that all
    attributes will be present in the request.

    This class allows the form to validate even if some (optional) attributes
    are not present in the original request. It does so by adding the default
    values (from the model) to the data from the request for each missing
    attribute. It must add these elements to the data object, as opposed to
    just passing it to the form's __init__ method as the 'initial' parameter
    since 'initial' is only used to render the HTML form and not for the
    validation of the data.

    UPDATE:
    This mixin has been updated to also populate form with values from an
    instance, if one has been provided.
    Note: this has not yet been tested, and likely does not work, on
    many-to-many relationships.
     __init__ N/A N/A self N/A args kwargs N/A N/A N/A N/A N/A super ModelForm self __init__ args kwargs N/A data N/A N/A N/A k v N/A N/A N/A self data items N/A N/A N/A data N/A k v N/A N/A self data data N/A field N/A N/A N/A N/A self instance __class__ _meta fields N/A N/A N/A N/A N/A field name N/A N/A N/A self data keys N/A N/A N/A N/A self data get N/A field name None N/A N/A inst_val None N/A N/A N/A self instance id N/A N/A N/A N/A inst_val N/A getattr N/A self instance N/A field name N/A inst_val N/A getattr inst_val id N/A N/A N/A N/A AttributeError ObjectDoesNotExist N/A N/A N/A N/A N/A self data N/A N/A field name inst_val N/A N/A N/A N/A field default NOT_PROVIDED N/A N/A N/A N/A self data N/A N/A field name N/A field default N/A N/A