Skip to content

Instantly share code, notes, and snippets.

@TheLittleNaruto
Created October 23, 2020 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheLittleNaruto/97a7d1a4ee9b562fdf255f7603aff280 to your computer and use it in GitHub Desktop.
Save TheLittleNaruto/97a7d1a4ee9b562fdf255f7603aff280 to your computer and use it in GitHub Desktop.
@year_api_blueprint.route('/all')
@app.app_context()
@cache.cached(timeout=500, key_prefix="years")
# @requires_login - this need to be public
def get_all_years():
data = Database.find("years", {})
if data is not None:
return jsonify([year for year in data])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment