Ejemplo n.º 1
0
class ProductVO(database.Model):
    __tablename__ = 'product_table'
    product_id = database.Column('product_id',
                                 database.Integer,
                                 primary_key=True,
                                 autoincrement=True)
    product_name = database.Column('product_name', database.String(100))
    product_description = database.Column('product_description',
                                          database.String(100))
    product_price = database.Column('product_price', database.Integer)
    product_image_name = database.Column('product_image_name',
                                         database.String(100),
                                         nullable=False)
    product_image_path = database.Column('product_image_path',
                                         database.String(100),
                                         nullable=False)
    product_category_name = database.Column(
        'product_category_name', database.Integer,
        database.ForeignKey(CategoryVO.category_id))
    product_subcategory_name = database.Column(
        'product_subcategory_name', database.Integer,
        database.ForeignKey(SubCategoryVO.subcategory_id))

    def as_dict(self):
        return {
            'product_id': self.product_id,
            'product_name': self.product_name,
            'product_description': self.product_description,
            'product_price': self.product_price,
            'product_image_name': self.product_image_name,
            'product_image_path': self.product_image_path,
            'category_name': self.product_category_name,
            'subcategory_name': self.product_subcategory_name
        }
Ejemplo n.º 2
0
class RegisterVO(database.Model):
    __tablename__ = 'user_table'
    user_id = database.Column('user_id',
                              database.Integer,
                              primary_key=True,
                              autoincrement=True)
    user_firstname = database.Column('user_firstname', database.String(100))
    user_lastname = database.Column('user_lastname', database.String(100))
    user_gender = database.Column('user_gender', database.String(100))
    user_address = database.column('user_address', database.String(255))
    user_pincode = database.Column('user_pincode', database.Integer)
    user_email = database.column('user_email', database.String(255))
    user_password = database.column('user_password', database.String(255))
    user_state_id = database.Column('user_state_id', database.Integer,
                                    database.ForeignKey(StateVO.state_id))
    user_city_id = database.Column('user_city_id', database.Integer,
                                   database.ForeignKey(CityVO.city_id))
    user_login_id = database.Column('user_login_id', database.Integer,
                                    database.ForeignKey(LoginVO.login_id))

    def as_dict(self):
        return {
            'user_id': self.user_id,
            'user_firstname': self.user_firstname,
            'user_lastname': self.user_lastname,
            'user_gender': self.user_gender,
            'user_address': self.user_address,
            'user_pincode': self.user_pincode,
            'user_state_id': self.user_state_id,
            'user_city_id': self.user_city_id,
            'user_login_id': self.user_login_id
        }
class SubCategoryVO(database.Model):
    __tablename__ = 'subcategory_table'
    subcategory_id = database.Column('subcategory_id', database.Integer, primary_key=True, autoincrement=True)
    subcategory_name = database.Column('subcategory_name', database.String(100), nullable=False)
    subcategory_description = database.Column('subcategory_description', database.String(100), nullable=False)
    subcategory_category_id = database.Column('subcategory_category_id', database.Integer,
                                              database.ForeignKey(CategoryVO.category_id))

    def as_dict(self):
        return {
            'subcategory_id': self.subcategory_id,
            'subcategory_name': self.subcategory_name,
            'subcategory_description': self.subcategory_description,
            'subcategory_category_id': self.subcategory_category_id
        }
Ejemplo n.º 4
0
class StateVO(database.Model):
    __tablename__ = 'state_table'
    state_id = database.Column('state_id',
                               database.Integer,
                               primary_key=True,
                               autoincrement=True)
    state_name = database.Column('state_name', database.String(100))
    state_description = database.Column('state_description',
                                        database.String(100))

    def as_dict(self):
        return {
            'state_id': self.state_id,
            'state_name': self.state_name,
            'state_description': self.state_description
        }
Ejemplo n.º 5
0
class CategoryVO(database.Model):
    __tablename__ = 'category_table'
    category_id = database.Column('category_id',
                                  database.Integer,
                                  primary_key=True,
                                  autoincrement=True)
    category_name = database.Column('category_name', database.String(100))
    category_description = database.Column('category_description',
                                           database.String(100))

    def as_dict(self):
        return {
            'category_id': self.category_id,
            'category_name': self.category_name,
            'category_description': self.category_description
        }
Ejemplo n.º 6
0
class AreaVO(database.Model):
    __tablename__ = 'area_table'
    area_id = database.Column('area_id', database.Integer, primary_key=True, autoincrement=True)
    area_name = database.Column('area_name', database.String(100))
    area_pincode = database.Column('area_pincode', database.Integer)
    area_state_id = database.Column('area_state_id', database.Integer, database.ForeignKey(StateVO.state_id))
    area_city_id = database.Column('area_city_id', database.Integer, database.ForeignKey(CityVO.city_id))

    def as_dict(self):
        return {
            'area_id': self.area_id,
            'area_name': self.area_name,
            'area_pincode': self.area_pincode,
            'area_state_id': self.area_state_id,
            'area_city_id': self.area_city_id
        }
Ejemplo n.º 7
0
class CartVO(database.Model):
    __tablename__ = 'cart_table'
    cart_id = database.Column('cart_id',
                              database.Integer,
                              primary_key=True,
                              autoincrement=True)
    cart_user_id = database.Column('cart_user_id', database.Integer)
    cart_product_id = database.Column('cart_product_id', database.Integer)
    product_quantity = database.Column('product_quantity', database.Integer)

    def as_dict(self):
        return {
            'cart_id': self.cart_id,
            'cart_user_id': self.cart_user_id,
            'cart_product_id': self.cart_product_id,
            'product_quantity': self.product_quantity
        }
Ejemplo n.º 8
0
class CityVO(database.Model):
    __tablename__ = 'city_table'
    city_id = database.Column('city_id',
                              database.Integer,
                              primary_key=True,
                              autoincrement=True)
    city_name = database.Column('city_name', database.String(100))
    city_description = database.Column('city_description',
                                       database.String(100))
    city_state_id = database.Column('city_state_id', database.Integer,
                                    database.ForeignKey(StateVO.state_id))

    def as_dict(self):
        return {
            'city_id': self.city_id,
            'city_name': self.city_name,
            'city_description': self.city_description,
            'city_state_id': self.city_state_id
        }
Ejemplo n.º 9
0
class UserVO(database.Model):
    __tablename__ = 'user_database'
    user_id = database.Column('user_id',
                              database.Integer,
                              primary_key=True,
                              autoincrement=True)
    user_name = database.Column('user_name', database.String(100))
    user_email_id = database.Column('user_email_id', database.String(100))
    user_password = database.Column('user_password',
                                    database.String(100),
                                    nullable=False)

    def as_dict(self):
        return {
            'user_id': self.user_id,
            'user_name': self.user_name,
            'user_email_id': self.user_email_id,
            'user_password': self.user_password
        }
Ejemplo n.º 10
0
class LoginVO(database.Model):
    __tablename__ = 'login_table'
    login_id = database.Column('login_id',
                               database.Integer,
                               primary_key=True,
                               autoincrement=True)
    login_username = database.Column('login_username',
                                     database.String(100),
                                     nullable=False)
    login_password = database.Column('login_password',
                                     database.String(100),
                                     nullable=False)
    login_role = database.Column('login_role',
                                 database.String(100),
                                 nullable=False)
    login_status = database.Column('login_status',
                                   database.String(100),
                                   nullable=False)
    login_secretkey = database.Column('login_secretkey',
                                      database.String(100),
                                      nullable=False)

    def as_dict(self):
        return {
            'login_id': self.login_id,
            'login_username': self.login_username,
            'login_password': self.login_password,
            'login_role': self.login_role,
            'login_status': self.login_status,
            'login_secretkey': self.login_secretkey
        }
Ejemplo n.º 11
0
class FeedbackVO(database.Model):
    __tablename__ = "feedback_table"
    feedback_id = database.Column("feedback_id",
                                  database.Integer,
                                  primary_key=True,
                                  autoincrement=True)
    feedback_description = database.Column("feedback_description",
                                           database.String(255),
                                           nullable=False)
    feedback_rating = database.Column("feedback_rating",
                                      database.Integer,
                                      nullable=False)
    feedback_datetime = database.Column("feedback_datetime", database.DateTime)
    feedback_login_id = database.Column("feedback_login_id", database.Integer,
                                        database.ForeignKey(LoginVO.login_id))

    def as_di1ct(self):
        return {
            "feedback_id": self.feedback_id,
            "feedback_description": self.feedback_description,
            "feedback_rating": self.feedback_rating,
            "feedback_datetime": self.feedback_datetime,
            "feedback_login_id": self.feedback_login_id,
        }
Ejemplo n.º 12
0
class ComplainVO(database.Model):
    __tablename__ = "complain_table"
    complain_id = database.Column("complain_id", database.Integer, primary_key=True, autoincrement=True)
    complain_subject = database.Column("complain_subject", database.String(255), nullable=False)
    complain_description = database.Column("complain_description", database.String(255), nullable=False)
    complain_datetime = database.Column("complain_datetime", database.DateTime)
    complain_status = database.Column("complain_status", database.String(20))
    complain_from_login_id = database.Column("complain_from_login_id", database.Integer, database.ForeignKey(LoginVO.login_id))
    complain_to_login_id = database.Column("complain_to_login_id", database.Integer, database.ForeignKey(LoginVO.login_id))
    complain_reply_description = database.Column("complain_reply_description", database.String(255))
    complain_reply_datetime = database.Column("complain_reply_datetime", database.DateTime)

    def as_di1ct(self):
        return {
            "complain_id": self.complain_id,
            "complain_subject": self.complain_subject,
            "complain_description": self.complain_description,
            "complain_datetime": self.complain_datetime,
            "complain_status": self.complain_status,
            "complain_from_login_id": self.complain_from_login_id,
            "complain_to_login_id": self.complain_to_login_id,
            "complain_reply_description": self.complain_reply_description,
            "complain_reply_datetime": self.complain_reply_datetime,
        }