17 lines
633 B
Python
17 lines
633 B
Python
from sqlalchemy import Column, Integer, ForeignKey, String
|
|
from sqlalchemy.orm import relationship
|
|
from .base import Base
|
|
|
|
class Group(Base):
|
|
__tablename__ = 'groups'
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
name = Column(String)
|
|
number = Column(Integer)
|
|
course = Column(Integer)
|
|
max_student_count = Column(Integer, default=30)
|
|
specialization_id = Column(Integer, ForeignKey('specializations.id'))
|
|
count_students = Column(Integer, default=0)
|
|
|
|
specialization = relationship("Specialization", back_populates="groups")
|
|
students = relationship("Student", back_populates="group") |