def has_field(model, fieldname):
 mapper = sqlalchemy_inspect(model)
 descriptors = mapper.all_orm_descriptors
 if (fieldname not in descriptors):
  return False
 field = descriptors[fieldname]
 if hasattr(field, 'fset'):
  return (field.fset is not None)
 return (not callable(getattr(model, fieldname)))

def has_field ( model , fieldname ) : mapper = sqlalchemy_inspect ( model ) descriptors = mapper . all_orm_descriptors if ( fieldname not in descriptors ) : return False field = descriptors [ fieldname ] if hasattr ( field , 'fset' ) : return ( field . fset is not None ) return ( not callable ( getattr ( model , fieldname ) ) )
returns true if the model has the specified field or if it has a settable hybrid property for this field name .