Skip to content

Commit fee1643

Browse files
committed
refactor
1 parent f0608bc commit fee1643

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

dictdatabase/object_mapper.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def _get_item_model(cls):
7474
for type_args in get_args(base):
7575
if issubclass(type_args, FileDictItemModel):
7676
return type_args
77-
raise AttributeError("FileDictModel must specify a FileDictItemModel")
77+
raise AttributeError(
78+
"FileDictModel must specify a FileDictItemModel "
79+
"(e.g. Users(FileDictModel[User]))"
80+
)
7881

7982

8083
@classmethod

dictdatabase/sessions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ class will be called.
6767

6868

6969

70+
########################################################################################
71+
#### File sessions
72+
########################################################################################
73+
74+
75+
7076
class SessionFileFull(SessionBase, Generic[T]):
7177
"""
7278
Context manager for read-write access to a full file.
@@ -140,6 +146,12 @@ def write(self):
140146

141147

142148

149+
########################################################################################
150+
#### File sessions
151+
########################################################################################
152+
153+
154+
143155
class SessionDirFull(SessionBase, Generic[T]):
144156
"""
145157
Context manager for read-write access to all files in a directory.

0 commit comments

Comments
 (0)