Skip to content
Snippets Groups Projects
Commit c2d60963 authored by thomaswoehlke's avatar thomaswoehlke
Browse files

Fixed #179 add Flask-Caching

parent d3edaf42
No related branches found
No related tags found
No related merge requests found
......@@ -136,14 +136,14 @@ class ApplicationDateReported(db.Model):
.one_or_none()
@classmethod
@cache.memoize(50)
# @cache.memoize(50)
def get_by_date_reported(cls, p_date_reported: str):
return db.session.query(cls)\
.filter(cls.date_reported_import_str == p_date_reported)\
.one()
@classmethod
@cache.memoize(50)
# @cache.memoize(50)
def find_by_date_reported(cls, p_date_reported: str):
return db.session.query(cls)\
.filter(cls.date_reported_import_str == p_date_reported)\
......@@ -208,7 +208,7 @@ class ApplicationRegion(db.Model):
return regions
@classmethod
@cache.memoize(50)
# @cache.memoize(50)
def get_by_id(cls, other_id: int):
return db.session.query(cls)\
.filter(cls.id == other_id)\
......@@ -221,7 +221,7 @@ class ApplicationRegion(db.Model):
.one_or_none()
@classmethod
@cache.memoize(50)
# @cache.memoize(50)
def get_by_region(cls, i_region: str):
return db.session.query(cls)\
.filter(cls.region == i_region)\
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment