Construct Django model instance from values provided in a python dict or Mapping

    Args:
      row (list or dict): Data (values of any type) to be assigned to fields in the Django object.
        If `row` is a list, then the column names (header row) can be provided in `field_names`.
        If `row` is a list and no field_names are provided, then `field_names` will be taken from the 
        Django model class field names, in the order they appear within the class definition.
      model (django.db.models.Model): The model class to be constructed with data from `row`
      field_names (list or tuple of str): The field names to place the row values in. 
        Defaults to the keys of the dict of `row` (if `row` is a `dict`) or the names of the fields
        in the Django model being constructed.
      ignore_fields (list or tuple of str): The field names to ignore if place the row values in. 

    Returns:
      Model instance: Django model instance constructed with values from `row` in fields
        from `field_names` or `model`'s fields

def django_object_from_row(row, model, field_names=None, ignore_fields=('id', 'pk'), ignore_related=True, strip=True, ignore_errors=True, verbosity=0):
    """Construct Django model instance from values provided in a python dict or Mapping

    Args:
      row (list or dict): Data (values of any type) to be assigned to fields in the Django object.
        If `row` is a list, then the column names (header row) can be provided in `field_names`.
        If `row` is a list and no field_names are provided, then `field_names` will be taken from the 
        Django model class field names, in the order they appear within the class definition.
      model (django.db.models.Model): The model class to be constructed with data from `row`
      field_names (list or tuple of str): The field names to place the row values in. 
        Defaults to the keys of the dict of `row` (if `row` is a `dict`) or the names of the fields
        in the Django model being constructed.
      ignore_fields (list or tuple of str): The field names to ignore if place the row values in. 

    Returns:
      Model instance: Django model instance constructed with values from `row` in fields
        from `field_names` or `model`'s fields
    """
    field_dict, errors = field_dict_from_row(row, model, field_names=field_names, ignore_fields=ignore_fields, strip=strip,
                                             ignore_errors=ignore_errors, ignore_related=ignore_related, verbosity=verbosity)
    if verbosity >= 3:
        print 'field_dict = %r' % field_dict
    try:
        obj = model(**field_dict)
        return obj, errors
    except:
        print_exc()
        raise ValueError('Unable to coerce the dict = %r into a %r object' % (field_dict, model))