Spaces:
Running
on
Zero
Running
on
Zero
File size: 562 Bytes
ee3a6ac a746d34 ee3a6ac a746d34 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
username = Column(String, unique=True)
password = Column(String)
profile = Column(String)
team_id = Column(Integer, ForeignKey("teams.id"))
team = relationship("Team", backref="users")
def __repr__(self):
return f"User(username={self.username}, profile={self.profile})" |