File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 11from datetime import datetime
2+ from typing import ClassVar
23
34from odmantic import Field , Model
45
@@ -10,3 +11,7 @@ class ApiKey(Model):
1011 created_at : datetime = Field (default_factory = datetime .now )
1112 expires_at : datetime
1213 is_active : bool = True
14+
15+ model_config : ClassVar [dict [str , str ]] = {
16+ "collection" : "api_keys"
17+ }
Original file line number Diff line number Diff line change 11from datetime import datetime
2+ from typing import ClassVar
23
34from odmantic import Model
45
56
67class RevokedToken (Model ):
78 token : str
89 expires_at : datetime
10+
11+ model_config : ClassVar [dict [str , str ]] = {
12+ "collection" : "revoked_tokens"
13+ }
Original file line number Diff line number Diff line change 1+ from typing import ClassVar
2+
13from odmantic import Model
24from pydantic import EmailStr
35
46
57class User (Model ):
68 email : EmailStr
79 password : str
10+
11+ model_config : ClassVar [dict [str , str ]] = {
12+ "collection" : "users"
13+ }
You can’t perform that action at this time.
0 commit comments