1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-25 14:34:19 +00:00
pds-2021-g2-nest/code/backend/nest_backend/database/tables/User.py
Lorenzo Balugani 013ce17aa8 Database implementation
All initial database classes are now properly implemented. Hurray!
2021-04-21 18:47:18 +02:00

16 lines
No EOL
527 B
Python

"""
This module defines the User database class.
"""
from ..base import Base
class User(Base.Model):
__tablename__ = "user"
email = Base.Column(Base.String, primary_key=True)
username = Base.Column(Base.String, nullable=False)
password = Base.Column(Base.LargeBinary, nullable=False)
isAdmin = Base.Column(Base.Boolean, default=False)
# Relationships
owner_of = Base.relationship("Repository", back_populates="owner")
authorizations = Base.relationship("Authorization", back_populates="user")