Exemple #1
0
class Notifications(db.Model):
    notification_id = db.Column(db.Integer, primary_key=True)
    post_id = db.Column(db.Integer,
                        db.ForeignKey('travel.id'),
                        primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
    content = db.Column(db.String(120), nullable=False)
    showed = db.Column(db.Boolean, nullable=False, default=False)
class RequestProduct(db.Model):
    __table_args__ = {'extend_existing': True}
    requestproduct_id = db.Column(db.Integer, primary_key=True)
    request_id = db.Column(db.Integer,
                           db.ForeignKey('request.request_id'),
                           nullable=False)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.product_id'),
                           nullable=False)
class Cart(db.Model):
    __table_args__ = {'extend_existing': True}
    cart_id = db.Column(db.Integer, primary_key=True)
    product_id = db.Column(db.Integer,
                           db.ForeignKey('product.product_id'),
                           nullable=False)
    user_id = db.Column(db.Integer,
                        db.ForeignKey('user.user_id'),
                        nullable=False)
Exemple #4
0
class Follow(db.Model):
    follower_id = db.Column(db.Integer,
                            db.ForeignKey('user.id'),
                            primary_key=True)
    followed_id = db.Column(db.Integer,
                            db.ForeignKey('user.id'),
                            primary_key=True)
    timestamp = db.Column(db.DateTime, default=datetime.utcnow)

    def __repr__(self):
        return f"Follow('{self.timestamp}')"
class Request(db.Model):
    __table_args__ = {'extend_existing': True}
    request_id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer,
                        db.ForeignKey('user.user_id'),
                        nullable=False)
    total_price = db.Column(db.Integer)
Exemple #6
0
class Post(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    body = db.Column(db.String(140))
    timestamp = db.Column(db.DateTime, index=True, default=datetime.utcnow)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))

    def __repr__(self):
        return '<Post {}>'.format(self.body)
Exemple #7
0
class Post(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.String(100), nullable=False)
    date_posted = db.Column(db.DateTime,
                            nullable=False,
                            default=datetime.utcnow)
    content = db.Column(db.Text, nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):
        return self.title + self.content + self.date_posted
class Product(db.Model):
    __table_args__ = {'extend_existing': True}
    product_id = db.Column(db.Integer, primary_key=True)
    product_name = db.Column(db.String(255), nullable=False)
    price = db.Column(db.Numeric(10, 2), nullable=False)
    desc = db.Column(db.Text, nullable=False)
    image = db.Column(db.String(255), nullable=False, default="default.jpg")
    pub_date = db.Column(db.DateTime, nullable=False, default=datetime.utcnow)
    category_id = db.Column(db.Integer,
                            db.ForeignKey('category.category_id'),
                            nullable=False)

    def __str__(self):
        return self.product_name
Exemple #9
0
class Travel(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    title = db.Column(db.Text, nullable=False)
    date_posted = db.Column(db.DateTime,
                            nullable=False,
                            default=datetime.utcnow)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
    start_date = db.Column(db.DateTime, nullable=False)
    end_date = db.Column(db.DateTime, nullable=False)
    country = db.Column(db.Text, nullable=False)
    city = db.Column(db.Text, nullable=False)
    latitude = db.Column(db.Integer, nullable=False)
    longitude = db.Column(db.Integer, nullable=False)
    content = db.Column(db.Text, nullable=False)
    subscribers = db.relationship('Subscriptions',
                                  backref='subscribers',
                                  lazy='dynamic',
                                  cascade='all, delete-orphan')

    def __repr__(self):
        return f"Travel('{self.date_posted}')"
Exemple #10
0
class Post(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    timestamp = db.Column(db.DateTime, index=True, default=datetime.utcnow)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
    username = db.Column(
        db.String(64),
        index=True)  #, unique=True <--used to be in there with index=True
    last_seen = db.Column(
        db.DateTime,
        default=datetime.utcnow)  #not sure i need this bc of timestamp
    name = db.Column(db.String(64))
    height = db.Column(db.Float(64))
    starting_weight = db.Column(db.Float(64))
    current_weight = db.Column(db.Float(64))
    goal_weight = db.Column(db.Float(64))
    starting_bf_percentage = db.Column(db.Float(64))
    current_bf_percentage = db.Column(db.Float(64))
    goal_bf_percentage = db.Column(db.Float(64))
    total_weight_lost = db.Column(db.Float(64))
    total_weight_gained = db.Column(db.Float(64))
    starting_fat_pounds = db.Column(db.Float(64))
    current_fat_pounds = db.Column(db.Float(64))
    goal_fat_pounds = db.Column(db.Float(64))
    fat_lost = db.Column(db.Float(64))
    starting_lean_bodymass = db.Column(db.Float(64))
    current_lean_bodymass = db.Column(db.Float(64))
    goal_lean_bodymass = db.Column(db.Float(64))
    bmi = db.Column(db.Float(64))
    nonfat_lost = db.Column(db.Float(64))
    goal_fat_loss = db.Column(db.Float(64))
    goal_weight_auto = db.Column(db.Float(64))
    goal_fat_loss_auto = db.Column(db.Float(64))
    goal_muscle_gain = db.Column(db.Float(64))

    def __repr__(self):
        return '<Post {}>'.format(self.id)  #not sure what self.? should be
Exemple #11
0
class Subscriptions(db.Model):
    post_id = db.Column(db.Integer,
                        db.ForeignKey('travel.id'),
                        primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
Exemple #12
0
class FriendsHandler(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
    friend_twitter_handler = db.Column(db.String(50), nullable=False)