Example #1
0
def drop_db_tables(app):
    with app.test_request_context():
        app.preprocess_request()
        db = g.sl('db')
        db.drop_tables()
Example #2
0
def create_db_tables(app):
    with app.test_request_context():
        app.preprocess_request()
        db = g.sl('db')
        db.create_tables()
Example #3
0
 def delete(self, id):
     service = g.sl('exertion_service')
     service.delete(id)
     return '', 204
Example #4
0
 def put(self, id):
     service = g.sl('exertion_service')
     service.update(id, **payload())
     return service.get(id), 200
Example #5
0
 def get(self, id):
     service = g.sl('exertion_service')
     return service.get(id)
Example #6
0
 def post(self):
     service = g.sl('exertion_service')
     id = service.create(**payload())
     location = full_url_for('api.exertion_item', id=id)
     return service.get(id), 201, {'Location': location}
Example #7
0
 def get(self):
     service = g.sl('exertion_service')
     return {'items': service.find_all()}