You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
342 B
Python
16 lines
342 B
Python
4 years ago
|
from flask import Blueprint
|
||
|
from app.models import Operation
|
||
|
from app.library.cache import cache
|
||
|
|
||
|
|
||
|
bp = Blueprint('api', 'api')
|
||
|
|
||
|
|
||
|
@bp.route('/api/info/<codename>')
|
||
|
def get_info(codename):
|
||
|
op = Operation.query.filter(Operation.codename == codename).first()
|
||
|
if op:
|
||
|
return cache.get_info(op.codename)
|
||
|
else:
|
||
|
return {}
|