Revize cbd239c6
Přidáno uživatelem Matěj Zeman před asi 2 roky(ů)
server/sql_app/models.py | ||
---|---|---|
165 | 165 |
ldpc = relationship("PC", back_populates="ld_pc") |
166 | 166 |
head_device = relationship("HeadDevice", back_populates="h_logs") |
167 | 167 |
body_device = relationship("BodyDevice", back_populates="b_logs") |
168 |
|
|
169 |
class User(Base): |
|
170 |
""" |
|
171 |
Class defining user in database with its own role |
|
172 |
""" |
|
173 |
__tablename__ = "users" |
|
174 |
|
|
175 |
id = Column(Integer, primary_key=True, index=True) |
|
176 |
username = Column(String, index=True, nullable=False) |
|
177 |
password = Column(String, index=True, nullable=False) |
|
178 |
role = Column(String, index=True, nullable=False) |
Také k dispozici: Unified diff
Added signup and users table in database. Passwords are hashed. Added view for changing users roles.