def get_relationship_properties(self, fields): model_alias = self.query_builder.get_resource_type(self.model) mapper = get_mapper(self.model) if model_alias not in fields: return list(mapper.relationships.values()) else: return [ mapper.relationships[field] for field in fields[model_alias] if field in mapper.relationships.keys() ]
def column_property_expressions(self): return dict([ (key, attr) for key, attr in get_mapper(self.model).attrs.items() if ( isinstance(attr, sa.orm.ColumnProperty) and not isinstance(attr.columns[0], sa.Column) ) ])
def is_relationship_field(self, field): return field in get_mapper(self.model).relationships.keys()