GoodbyeSQL 0.5.3__tar.gz → 0.5.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/PKG-INFO +1 -1
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/PKG-INFO +1 -1
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/goodbyesql/config.py +2 -4
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/goodbyesql/main.py +12 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/setup.py +1 -1
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/SOURCES.txt +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/dependency_links.txt +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/entry_points.txt +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/requires.txt +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/GoodbyeSQL.egg-info/top_level.txt +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/README.md +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/goodbyesql/__init__.py +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/goodbyesql/registry.py +0 -0
- {goodbyesql-0.5.3 → goodbyesql-0.5.5}/setup.cfg +0 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
1
|
from typing import Any
|
|
3
2
|
from pydantic_settings import BaseSettings
|
|
4
3
|
from typing import List, Annotated
|
|
@@ -7,10 +6,9 @@ from fastapi import Depends
|
|
|
7
6
|
from goodbyesql.registry import get_session
|
|
8
7
|
|
|
9
8
|
|
|
10
|
-
@dataclass
|
|
11
9
|
class GoodbyeSQLConfig(BaseSettings):
|
|
12
|
-
user_model:
|
|
13
|
-
username_field: str = '
|
|
10
|
+
user_model: Any
|
|
11
|
+
username_field: str = 'Any'
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
|
|
@@ -4,6 +4,7 @@ from goodbyesql.config import GoodbyeSQLConfig
|
|
|
4
4
|
from typing import Annotated
|
|
5
5
|
from fastapi import Depends
|
|
6
6
|
from goodbyesql.registry import get_session
|
|
7
|
+
from pydantic import EmailStr
|
|
7
8
|
|
|
8
9
|
DB_Session = Annotated[AsyncSession, Depends(get_session)]
|
|
9
10
|
|
|
@@ -23,6 +24,17 @@ class GoodbyeSQL:
|
|
|
23
24
|
return user
|
|
24
25
|
|
|
25
26
|
|
|
27
|
+
async def get_info_by_email(self, *, session: DB_Session, email: EmailStr):
|
|
28
|
+
|
|
29
|
+
model = self.config.user_model
|
|
30
|
+
field = getattr(model, self.config.username_field)
|
|
31
|
+
|
|
32
|
+
query = select(model).where(field == email)
|
|
33
|
+
result = await session.execute(query)
|
|
34
|
+
|
|
35
|
+
info: None = result.scalar_one_or_none()
|
|
36
|
+
|
|
37
|
+
return info
|
|
26
38
|
|
|
27
39
|
def check_my_library():
|
|
28
40
|
print("It is working right now!")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|