Update
This commit is contained in:
parent
747721031a
commit
3e1e1bf250
|
@ -17,11 +17,15 @@ class DatingOrm(Model):
|
||||||
id: Mapped[int] = mapped_column(primary_key=True, unique=True, autoincrement=True)
|
id: Mapped[int] = mapped_column(primary_key=True, unique=True, autoincrement=True)
|
||||||
sessionkey: Mapped[str] = mapped_column(unique=True)
|
sessionkey: Mapped[str] = mapped_column(unique=True)
|
||||||
theme_name: Mapped[str]
|
theme_name: Mapped[str]
|
||||||
|
sender_looking_relationship: Mapped[str]
|
||||||
sender_name: Mapped[str]
|
sender_name: Mapped[str]
|
||||||
sender_sex: Mapped[str]
|
sender_sex: Mapped[str]
|
||||||
sender_age: Mapped[int]
|
sender_age: Mapped[int]
|
||||||
sender_city: Mapped[str]
|
sender_city: Mapped[str]
|
||||||
telegram_name: Mapped[str]
|
telegram_name: Mapped[str]
|
||||||
|
sender_relationship: Mapped[str]
|
||||||
|
sender_having_kids: Mapped[str]
|
||||||
|
sender_want_to_have_kids: Mapped[str]
|
||||||
interests_in_school_university: Mapped[str]
|
interests_in_school_university: Mapped[str]
|
||||||
interests_in_sports: Mapped[str]
|
interests_in_sports: Mapped[str]
|
||||||
interests_in_work: Mapped[str]
|
interests_in_work: Mapped[str]
|
||||||
|
|
|
@ -5,8 +5,9 @@ from .schemas import SDatingAdd, SDating
|
||||||
|
|
||||||
class DatingRepository:
|
class DatingRepository:
|
||||||
@classmethod
|
@classmethod
|
||||||
async def add_dating(cls, dating: SDatingAdd) -> int:
|
async def add_dating(cls, dating: SDatingAdd) -> int | None:
|
||||||
async with new_session() as session:
|
async with new_session() as session:
|
||||||
|
try:
|
||||||
data = dating.model_dump()
|
data = dating.model_dump()
|
||||||
new_dating = DatingOrm(**data)
|
new_dating = DatingOrm(**data)
|
||||||
|
|
||||||
|
@ -14,6 +15,9 @@ class DatingRepository:
|
||||||
await session.flush()
|
await session.flush()
|
||||||
await session.commit()
|
await session.commit()
|
||||||
return new_dating.id
|
return new_dating.id
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return None
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def get_datings(cls) -> list[SDating]:
|
async def get_datings(cls) -> list[SDating]:
|
||||||
|
|
|
@ -5,11 +5,15 @@ from pydantic import BaseModel, ConfigDict
|
||||||
class SDatingAdd(BaseModel):
|
class SDatingAdd(BaseModel):
|
||||||
sessionkey: str
|
sessionkey: str
|
||||||
theme_name: str
|
theme_name: str
|
||||||
|
sender_looking_relationship: str
|
||||||
sender_name: str
|
sender_name: str
|
||||||
sender_sex: str
|
sender_sex: str
|
||||||
sender_age: int
|
sender_age: int
|
||||||
sender_city: str
|
sender_city: str
|
||||||
telegram_name: str
|
telegram_name: str
|
||||||
|
sender_relationship: str
|
||||||
|
sender_having_kids: str
|
||||||
|
sender_want_to_have_kids: str
|
||||||
interests_in_school_university: str
|
interests_in_school_university: str
|
||||||
interests_in_sports: str
|
interests_in_sports: str
|
||||||
interests_in_work: str
|
interests_in_work: str
|
||||||
|
|
4
push.sh
4
push.sh
|
@ -20,6 +20,10 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f ".git/index.lock" ]; then
|
||||||
|
rm ".git/index.lock"
|
||||||
|
fi
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Update"
|
git commit -m "Update"
|
||||||
git push $git
|
git push $git
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue