Ejemplo n.º 1
0
class Ticket(db.Model):  # не закрив ticket_controller
    id = db.Column(db.Integer, primary_key=True, unique=True)
    name = db.Column(db.VARCHAR(length=40), nullable=False)
    description = db.Column(db.VARCHAR(length=400))
    price = db.Column(db.Integer)
    endTimeReservation = db.Column(db.TIMESTAMP)
    reservationPrice = db.Column(db.Integer)
    status = db.Column(db.VARCHAR(20))
Ejemplo n.º 2
0
class Teacher(db.Model):
    __tablename__ = 'teachers'
    tid = db.Column('tid', db.Integer, primary_key=True)
    username = db.Column('username', db.VARCHAR(length=30), nullable=False)
    password = db.Column('password', db.VARCHAR(length=128), nullable=False)
    first_name = db.Column('first_name', db.VARCHAR(length=30))
    last_name = db.Column('last_name', db.VARCHAR(length=40))

    def __init__(self, username, password, first_name, last_name):
        self.username = username
        self.password = generate_password_hash(password)
        self.first_name = first_name
        self.last_name = last_name
Ejemplo n.º 3
0
class Category(db.Model):  # не закрив ticket_controller
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.VARCHAR(length=40))
Ejemplo n.º 4
0
class Reservation(db.Model):
    id = db.Column(db.Integer, primary_key=True, unique=True)
    ticket_id = db.Column(db.Integer, db.ForeignKey(Ticket.id), unique=True)
    ticket = db.relationship("Ticket", backref="reservation")
    status = db.Column(db.VARCHAR(20))
Ejemplo n.º 5
0
class User(db.Model):  # закрив user_controller
    id = db.Column(db.Integer, primary_key=True)
    username = db.Column(db.VARCHAR(length=40), nullable=False)
    email = db.Column(db.VARCHAR(30), nullable=False)
    password = db.Column(db.VARCHAR(128), nullable=False)
Ejemplo n.º 6
0
class Student(db.Model):
    __tablename__ = 'students'
    sid = db.Column('sid', db.Integer, primary_key=True)
    first_name = db.Column('first_name', db.VARCHAR(length=30))
    last_name = db.Column('last_name', db.VARCHAR(length=40))
    total_rating = db.Column('total_rating', db.Integer)