Spaces:
Build error
Build error
File size: 560 Bytes
b7a7f32 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship
from core.db import Base
class TeacherNote(Base):
id = Column(Integer, primary_key=True)
user_id = Column(Integer, ForeignKey("user.id", ondelete="cascade"))
user = relationship("User", backref="teachernote", foreign_keys=[user_id])
student_id = Column(Integer, ForeignKey("user.id", ondelete="cascade"))
student = relationship("User", foreign_keys=[student_id])
message = Column(String(length=512))
__tablename__ = "teachernote"
|