home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Re-write caching.
[plomtask]
/
plomtask
/
days.py
diff --git
a/plomtask/days.py
b/plomtask/days.py
index d838039a715677ffb3c9022f82715859d80fd652..5fe984b7c49596121246bb7e822c8b4bb1536139 100644
(file)
--- a/
plomtask/days.py
+++ b/
plomtask/days.py
@@
-24,7
+24,7
@@
def todays_date() -> str:
return datetime.now().strftime(DATE_FORMAT)
return datetime.now().strftime(DATE_FORMAT)
-class Day(BaseModel):
+class Day(BaseModel
[str]
):
"""Individual days defined by their dates."""
table_name = 'days'
to_save = ['comment']
"""Individual days defined by their dates."""
table_name = 'days'
to_save = ['comment']
@@
-77,7
+77,7
@@
class Day(BaseModel):
if not create:
raise NotFoundException(f'Day not found for date: {date}')
day = cls(date)
if not create:
raise NotFoundException(f'Day not found for date: {date}')
day = cls(date)
- d
b_conn.cached_days[date] = day
+ d
ay.cache()
assert isinstance(day, Day)
return day
assert isinstance(day, Day)
return day