예제 #1
0
 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()
         ]
예제 #2
0
 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)
         )
     ])
예제 #3
0
 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)
         )
     ])
예제 #4
0
 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()
         ]
예제 #5
0
 def is_relationship_field(self, field):
     return field in get_mapper(self.model).relationships.keys()
예제 #6
0
 def is_relationship_field(self, field):
     return field in get_mapper(self.model).relationships.keys()