mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 11:04:01 +03:00
d45d98e300
* Add application * Dockerize the app * Fix 204 content-leength error * Rename database file * Add tests * Add README * Fix a typo in FastAPI example * Add docs on FastAPI + SQLAlchemy example * Update changelog * Add link to the example to README and other docs pages * Add EOF to the config.yml
22 lines
545 B
Python
22 lines
545 B
Python
"""Models module."""
|
|
|
|
from sqlalchemy import Column, String, Boolean, Integer
|
|
|
|
from .database import Base
|
|
|
|
|
|
class User(Base):
|
|
|
|
__tablename__ = 'users'
|
|
|
|
id = Column(Integer, primary_key=True)
|
|
email = Column(String, unique=True)
|
|
hashed_password = Column(String)
|
|
is_active = Column(Boolean, default=True)
|
|
|
|
def __repr__(self):
|
|
return f'<User(id="{self.id}", ' \
|
|
f'email="{self.email}", ' \
|
|
f'hashed_password="{self.hashed_password}", ' \
|
|
f'is_active="{self.is_active}")>'
|