Пример #1
0
class Menu(GenericModel):
    id = db.Column('menu_id', db.Integer(), primary_key=True)
    name = db.Column('menu_name', db.String(40),)
    price = db.Column('menu_price', db.Float())
    href = db.relationship('Hotel',secondary=menu_hotel, backref=db.backref("menuref", lazy=True))

    @staticmethod
    def get_dummy_menu():
       return Menu(id=0,name='',price=0.0)
Пример #2
0
class Room(GenericModel):
    id = db.Column('room_id', db.Integer(), primary_key=True)
    type = db.Column('room_type', db.String(40),)
    charge = db.Column('room_charge',db.Float())
    status = db.Column('room_status',db.String(30))


    @staticmethod
    def get_dummy_room():
       return Room(id=0,type='',charge=0.0,status='')
Пример #3
0
class Note(db.Model):
    __tablename__ = "note"
    note_id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(32))
    content = db.Column(db.String(32))
    createdtime = db.Column(
        db.DateTime, default=datetime.utcnow)
    modifiedtime = db.Column(
        db.DateTime, default=datetime.utcnow, onupdate=datetime.utcnow
    )
Пример #4
0
class Account(GenericModel):
    id = db.Column('acc_no', db.Integer(), primary_key=True)
    type = db.Column('acc_type', db.String(40))
    balance = db.Column('acc_bal', db.Float())
    hotelref = db.relationship(Hotel,lazy=True,backref="haccref",uselist=True)
    custref = db.relationship("Customer",lazy=True,backref="caccref",uselist=True)

    @staticmethod
    def get_dummy_account():
       return Account(id=0,type='',balance=0.0)
Пример #5
0
class Status(db.Model):
    id_status = db.Column(db.Integer, primary_key=True, unique=True)
    status_name = db.Column(db.String(10), unique=True)
    status_description = db.Column(db.String(100))
    timestamp = db.Column(db.DateTime,
                          default=datetime.utcnow,
                          onupdate=datetime.utcnow)

    def __init__(self, status_name, status_description):
        self.status_name = status_name
        self.status_description = status_description
Пример #6
0
class User(db.Model, UserMixin):
    __tablename__ = 'User'
    userId = db.Column(db.Integer, primary_key=True)
    userInfo = db.Column(db.String(20))
    userPwd = db.Column(db.Integer)
    userPhone = db.Column(db.Integer)
    userzip = db.relationship('userZip')

    def __init__(self, userId, userInfo, userPwd, userPhone):
        self.userId = userId
        self.userInfo = userInfo
        self.userPwd = userPwd
        self.userPhone = userPhone
Пример #7
0
class userZip(db.Model, UserMixin):
    __tablename__ = 'userZip'
    id = db.Column(db.Integer, primary_key=True)
    usermsg = db.Column(db.String(100))
    img_name = db.Column(db.String(40))
    img = db.Column(db.LargeBinary(length=2048))
    userId = db.Column(db.Integer, db.ForeignKey('User.userId'))

    def __init__(self, id, usermsg, img_name, img, userId):
        self.id = id
        self.usermsg = usermsg
        self.img_name = img_name
        self.img = img
        self.userId = userId
Пример #8
0
class ProcessedOrder(GenericModel):
    pid = db.Column('pr_order_id', db.Integer(), primary_key=True)
    orderId = db.Column("order_id",db.ForeignKey("mainorder.order_id"),unique=False)
    menuid =  db.Column("menus",db.ForeignKey("menu.menu_id"),unique=False,nullable=True)
    roomid = db.Column("room",db.ForeignKey("room.room_id"),unique=False,nullable=True)
    finalprice = db.Column('menu_price', db.Float())
    qty = db.Column('menu_qty', db.Integer())
Пример #9
0
class Note(db.Model):
    __tablename__ = 'notes'

    noteId = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(100), unique=True, nullable=False)
    text = db.Column(db.Text, unique=False, nullable=False)
    date = db.Column(db.DateTime, default=datetime.utcnow)

    def __init__(self, **kwargs):
        super(Note, self).__init__(**kwargs)

    def __repr__(self):
        return '<Note %r>' % self.title

    @property
    def serialize(self):
        return {
            'noteId': self.noteId,
            'title': self.title,
            'text': self.text,
            'date': self.date
        }
Пример #10
0
class Arch_Note(db.Model):
    __tablename__ = "arch_note"
    id = db.Column(db.Integer, primary_key=True)
    note_id = db.Column(db.Integer)
    title = db.Column(db.String(32))
    content = db.Column(db.String(32))
    comment =db.Column(db.String(32))
    createdtime = db.Column(
        db.DateTime, default=datetime.utcnow)
Пример #11
0
class Customer(GenericModel):
    id = db.Column('cust_id', db.Integer(), primary_key=True)
    name = db.Column('cust_name', db.String(40), unique=True)
    address = db.Column('cust_address', db.String(40),)
    contact = db.Column('cust_contact',db.BigInteger())
    email = db.Column('cust_email',db.String(40))
    accno = db.Column("acc_id", db.ForeignKey("account.acc_no"), unique=False, nullable=True)
    orderref = db.relationship("Mainorder",lazy=True,backref="custref",uselist=True)

    @staticmethod
    def get_dummy_customer():
       return Customer(id=0,name='',address='',contact='',email='')
Пример #12
0
class Customer(db.Model):
    id_cliente = db.Column(db.String(25), primary_key=True, unique=True)
    nombre = db.Column(db.String(50))
    apellido = db.Column(db.String(50))
    email = db.Column(db.String(150), primary_key=True, unique=True)
    direccion = db.Column(db.String(250))
    telefono = db.Column(db.String(25))
    mobil = db.Column(db.String(25))
    no_documento = db.Column(db.String(50))
    timestamp = db.Column(db.DateTime,
                          default=datetime.utcnow,
                          onupdate=datetime.utcnow)

    def __init__(self, id_cliente, nombre, apellido, email, direccion,
                 telefono, mobil, no_documento):
        self.id_cliente = id_cliente
        self.nombre = nombre
        self.apellido = apellido
        self.email = email
        self.direccion = direccion
        self.telefono = telefono
        self.mobil = mobil
        self.no_documento = no_documento
Пример #13
0
class Hotel(GenericModel):
    id = db.Column('hotel_id',db.Integer(),primary_key=True)
    name = db.Column('hotel_name',db.String(40),unique=True)
    address = db.Column('hotel_address',db.String(40))
    contact = db.Column('hotel_contact',db.Integer())
    website = db.Column('hotel_website', db.String(40))
    accno = db.Column("acc_id", db.ForeignKey("account.acc_no"), unique=False, nullable=True)
    #menuref = db.relationship("Menu",secondary='menu_hotel',backref=db.backref("hotelref1",uselist=True))
    roomref = db.relationship("Room", secondary=room_hotel, backref=db.backref("rhotelref", uselist=True))
    orderref = db.relationship("Mainorder", lazy=True, backref="ohotelref", uselist=True)

    @staticmethod
    def get_dummy_hotel():
        return Hotel(id=0, name='', address='', contact=0,website='')
Пример #14
0
class Login(GenericModel):
    username=db.Column('username',db.String(50),primary_key=True)
    password=db.Column('password',db.String(50))
Пример #15
0
class Mainorder(GenericModel):
    id = db.Column('order_id', db.Integer(), primary_key=True)
    csid = db.Column('cust_id', db.ForeignKey("customer.cust_id"),nullable=False,unique=False)
    htid = db.Column('hotel_id', db.ForeignKey("hotel.hotel_id"),nullable=False,unique=False)
    billamount = db.Column('total_bill', db.Float())
Пример #16
0
from configuration import db,app

class GenericModel(db.Model):
    __abstract__ = True
    created = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated = db.Column(db.DateTime, default=db.func.current_timestamp(),onupdate=db.func.current_timestamp())
    active = db.Column('active', db.String(10),default='Yes')

menu_hotel = db.Table('menu_hotel',
    db.Column('menu_id',db.ForeignKey('menu.menu_id')),
    db.Column('hotel_id',db.ForeignKey('hotel.hotel_id'))
)
class Menu(GenericModel):
    id = db.Column('menu_id', db.Integer(), primary_key=True)
    name = db.Column('menu_name', db.String(40),)
    price = db.Column('menu_price', db.Float())
    href = db.relationship('Hotel',secondary=menu_hotel, backref=db.backref("menuref", lazy=True))

    @staticmethod
    def get_dummy_menu():
       return Menu(id=0,name='',price=0.0)

room_hotel = db.Table('room_hotel',
                      db.Column('room_id',db.ForeignKey('room.room_id'),unique=False),
                      db.Column('hotel_id',db.ForeignKey('hotel.hotel_id'),unique=False)
                      )

class Hotel(GenericModel):
    id = db.Column('hotel_id',db.Integer(),primary_key=True)
    name = db.Column('hotel_name',db.String(40),unique=True)
    address = db.Column('hotel_address',db.String(40))
Пример #17
0
class GenericModel(db.Model):
    __abstract__ = True
    created = db.Column(db.DateTime, default=db.func.current_timestamp())
    updated = db.Column(db.DateTime, default=db.func.current_timestamp(),onupdate=db.func.current_timestamp())
    active = db.Column('active', db.String(10),default='Yes')