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)
|
||||
sessionkey: Mapped[str] = mapped_column(unique=True)
|
||||
theme_name: Mapped[str]
|
||||
sender_looking_relationship: Mapped[str]
|
||||
sender_name: Mapped[str]
|
||||
sender_sex: Mapped[str]
|
||||
sender_age: Mapped[int]
|
||||
sender_city: 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_sports: Mapped[str]
|
||||
interests_in_work: Mapped[str]
|
||||
|
|
|
@ -5,15 +5,19 @@ from .schemas import SDatingAdd, SDating
|
|||
|
||||
class DatingRepository:
|
||||
@classmethod
|
||||
async def add_dating(cls, dating: SDatingAdd) -> int:
|
||||
async def add_dating(cls, dating: SDatingAdd) -> int | None:
|
||||
async with new_session() as session:
|
||||
data = dating.model_dump()
|
||||
new_dating = DatingOrm(**data)
|
||||
try:
|
||||
data = dating.model_dump()
|
||||
new_dating = DatingOrm(**data)
|
||||
|
||||
session.add(new_dating)
|
||||
await session.flush()
|
||||
await session.commit()
|
||||
return new_dating.id
|
||||
session.add(new_dating)
|
||||
await session.flush()
|
||||
await session.commit()
|
||||
return new_dating.id
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
async def get_datings(cls) -> list[SDating]:
|
||||
|
|
|
@ -5,11 +5,15 @@ from pydantic import BaseModel, ConfigDict
|
|||
class SDatingAdd(BaseModel):
|
||||
sessionkey: str
|
||||
theme_name: str
|
||||
sender_looking_relationship: str
|
||||
sender_name: str
|
||||
sender_sex: str
|
||||
sender_age: int
|
||||
sender_city: str
|
||||
telegram_name: str
|
||||
sender_relationship: str
|
||||
sender_having_kids: str
|
||||
sender_want_to_have_kids: str
|
||||
interests_in_school_university: str
|
||||
interests_in_sports: str
|
||||
interests_in_work: str
|
||||
|
|
4
push.sh
4
push.sh
|
@ -20,6 +20,10 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
if [ -f ".git/index.lock" ]; then
|
||||
rm ".git/index.lock"
|
||||
fi
|
||||
|
||||
git add .
|
||||
git commit -m "Update"
|
||||
git push $git
|
||||
|
|
3949
templates/index.html
3949
templates/index.html
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue