예제 #1
0
파일: models.py 프로젝트: Rdbaker/Rovu-API
 def get(cls, id):
     """Get an instance from its id."""
     return DB.query(cls).get(id)
예제 #2
0
파일: models.py 프로젝트: Rdbaker/Rovu-API
 def query(cls):
     return DB.query(cls)
예제 #3
0
 def _query_collection(self, cls, schema):
     """Query a collection of a class passed in and return the JSON dump of its schema"""
     return json.dumps(json.loads(schema.dumps(DB.query(cls).all(), many=True).data))