1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-27 07:24:17 +00:00
pds-2021-g2-nest/nest_backend/database/tables/Authorization.py

13 lines
497 B
Python
Raw Normal View History

"""
This module defines the Authorization database class.
"""
2021-05-07 17:46:14 +00:00
from ..base import ext
2021-05-07 17:46:14 +00:00
class Authorization(ext.Model):
rid = ext.Column(ext.Integer, ext.ForeignKey("repository.id", ondelete="CASCADE"), primary_key=True)
email = ext.Column(ext.String, ext.ForeignKey("user.email", ondelete="CASCADE"), primary_key=True)
# Relationships
2021-05-07 17:46:14 +00:00
repository = ext.relationship("Repository", back_populates="authorizations")
user = ext.relationship("User", back_populates="authorizations")