def get_field_meta(field):
    """
    returns a dictionary with some metadata from field of a model
    """
    out = { 'name' : field.name, 'is_relation' : field.is_relation, 'class_name' : field.__class__.__name__}
    if field.is_relation:
        out['related_model'] = "%s.%s" % (field.related_model._meta.app_label, field.related_model.__name__)

    else:
        out['default'] = field.get_default()

    try:
        out['null'] = field.null
    except:
        pass

    return out