code: def model_field_attr(model, model_field, attr):
      
      fields = dict([(field.name, field) for field in model._meta.fields])
      return getattr(fields[model_field], attr)
docs: Returns the specified attribute for the specified field on the model class.