I am learning to program in order to simplify my life and create something new
from datetime import date
from sqlalchemy import select
from sqlalchemy import and_
from sqlalchemy.ext.asyncio import AsyncSession
from core.models import engine
class AboutMe():
def __init__(self):
async with AsyncSession(engine) as session:
user = session.scalar(
select(Users)
.where(
and_(
user_id=1,
user_name='MrBenoit'
)
)
)
print(user.username)
> MrBenoit
print(user.pronouns)
> ["he", "him"]
print(user.location)
> {"Russian": "Moscow"}
print(user.occupation)
> Computer Science Student
print(user.birthday)
> 16.06.2004
print(user.age)
> 19
print(user.hobbies)
> ["Coding", "Gaming", "Anime", "Gym"]
print(user.interests)
> ["Programming", "Music", "Open Source"]
if __name__ == "__main__":
me = AboutMe()