This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Response, jsonify | |
import json | |
from flask_restful import Resource | |
class Api(Resource): | |
def post(self): | |
response = Response( | |
response=json.dumps(dict(error='err')), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START, END, WINDOW = 0, 15, 5 | |
def pages(page): | |
start = page - WINDOW/2 | |
end = page + WINDOW/2 | |
if start >= START and end <= END: | |
return range(start, end+1) | |
if start <= START: |
OlderNewer