def entities_index(obj_id): query = Property.all() query = query.filter(Property.relation_id != None) obj = Entity.by_id(obj_id) query = query.filter_by(entity_id=obj_id) return _index(query, obj)
def relations_index(obj_id): query = Property.all() query = query.filter(Property.relation_id != None) obj = Relation.by_id(obj_id) query = query.filter_by(relation_id=obj_id) return _index(query, obj)