|
|
@ -23,7 +23,6 @@ api = flask_restful.Api(app)
|
|
|
|
|
|
|
|
|
|
|
|
quote_fields = {
|
|
|
|
quote_fields = {
|
|
|
|
'id': flask_restful.fields.Integer(),
|
|
|
|
'id': flask_restful.fields.Integer(),
|
|
|
|
'video_id': flask_restful.fields.Integer(),
|
|
|
|
|
|
|
|
'date': flask_restful.fields.DateTime(dt_format='iso8601'),
|
|
|
|
'date': flask_restful.fields.DateTime(dt_format='iso8601'),
|
|
|
|
'game': flask_restful.fields.String(),
|
|
|
|
'game': flask_restful.fields.String(),
|
|
|
|
'text': flask_restful.fields.String(),
|
|
|
|
'text': flask_restful.fields.String(),
|
|
|
@ -34,7 +33,6 @@ quote_fields = {
|
|
|
|
|
|
|
|
|
|
|
|
quote_parser = flask_restful.reqparse.RequestParser()
|
|
|
|
quote_parser = flask_restful.reqparse.RequestParser()
|
|
|
|
quote_parser.add_argument('id', type=int)
|
|
|
|
quote_parser.add_argument('id', type=int)
|
|
|
|
quote_parser.add_argument('video_id', type=int)
|
|
|
|
|
|
|
|
quote_parser.add_argument('date', type=flask_restful.inputs.date, required=True)
|
|
|
|
quote_parser.add_argument('date', type=flask_restful.inputs.date, required=True)
|
|
|
|
quote_parser.add_argument('game', type=str, required=True)
|
|
|
|
quote_parser.add_argument('game', type=str, required=True)
|
|
|
|
quote_parser.add_argument('text', type=str, required=True)
|
|
|
|
quote_parser.add_argument('text', type=str, required=True)
|
|
|
@ -80,7 +78,6 @@ class QuoteResource(flask_restful.Resource):
|
|
|
|
quote = q.first()
|
|
|
|
quote = q.first()
|
|
|
|
if not quote:
|
|
|
|
if not quote:
|
|
|
|
quote = Quote(id=id, created_at=now)
|
|
|
|
quote = Quote(id=id, created_at=now)
|
|
|
|
quote.video_id = args['video_id'] # FIXME: NULL
|
|
|
|
|
|
|
|
quote.date = args['date']
|
|
|
|
quote.date = args['date']
|
|
|
|
quote.game = args['game']
|
|
|
|
quote.game = args['game']
|
|
|
|
quote.text = args['text']
|
|
|
|
quote.text = args['text']
|
|
|
@ -135,7 +132,6 @@ class QuotesResource(flask_restful.Resource):
|
|
|
|
quote = q.first()
|
|
|
|
quote = q.first()
|
|
|
|
if not quote:
|
|
|
|
if not quote:
|
|
|
|
quote = Quote(id=args['id'], created_at=now)
|
|
|
|
quote = Quote(id=args['id'], created_at=now)
|
|
|
|
quote.video_id = args['video_id'] # FIXME: NULL
|
|
|
|
|
|
|
|
quote.date = args['date']
|
|
|
|
quote.date = args['date']
|
|
|
|
quote.game = args['game']
|
|
|
|
quote.game = args['game']
|
|
|
|
quote.text = args['text']
|
|
|
|
quote.text = args['text']
|
|
|
|