home
·
contact
·
privacy
projects
/
plomtask
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fuse Day.by_id_or_create and Day.by_id, as valid_date call in the first one fits...
[plomtask]
/
plomtask
/
db.py
diff --git
a/plomtask/db.py
b/plomtask/db.py
index e95c27d52133ed16d448f221f9f6df89efd25fde..71c59d50d8b0013dcf3bd9e6c811080563606830 100644
(file)
--- a/
plomtask/db.py
+++ b/
plomtask/db.py
@@
-330,6
+330,11
@@
class BaseModel(Generic[BaseModelId]):
assert isinstance(as_dict['id'], (int, str))
return as_dict['id']
assert isinstance(as_dict['id'], (int, str))
return as_dict['id']
+ @classmethod
+ def name_lowercase(cls) -> str:
+ """Convenience method to return cls' name in lowercase."""
+ return cls.__name__.lower()
+
# cache management
# (we primarily use the cache to ensure we work on the same object in
# memory no matter where and how we retrieve it, e.g. we don't want
# cache management
# (we primarily use the cache to ensure we work on the same object in
# memory no matter where and how we retrieve it, e.g. we don't want