home · contact · privacy
Refactor request handler delete or retrieving items on POST.
[plomtask] / plomtask / db.py
index e95c27d52133ed16d448f221f9f6df89efd25fde..71c59d50d8b0013dcf3bd9e6c811080563606830 100644 (file)
@@ -330,6 +330,11 @@ class BaseModel(Generic[BaseModelId]):
         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