Gurucool_Test / models /teacher_note.py
ashwinR's picture
Upload 245 files
b7a7f32
raw
history blame contribute delete
560 Bytes
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"