def dump_model(obj):
    """Returns ``obj`` as a dict.

    Returnded dic has a form of:
    {
        'field_name': {
            'type': `FieldType`,
            'value': field value,
            # if field is a relation, it also has:
            'rel': {
                'db_table': model db table,
                'app_label': model app label,
                'model_name': model name
            }
        }
    }
    """
    data = {}
    for field in obj._meta.fields:
        if isinstance(field, RELATED_FIELDS):
            field_data = _related_field_data(field, obj)
        else:
            field_data = _basic_field_data(field, obj)
        data[field.name] = field_data

    if obj.pk:
        for m2m in obj._meta.many_to_many:
            field_data = _m2m_field_data(m2m, obj)
            data[m2m.name] = field_data

    return data