Пример #1
0
class Lunch(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    foodname = db.Column(db.String(100), nullable=False)
    mass = db.Column(db.Integer(), nullable=False)
    calories = db.Column(db.Integer(), nullable=False)
    protein = db.Column(db.Integer(), nullable=False)
    carbohydrates = db.Column(db.Integer(), nullable=False)
    fats = db.Column(db.Integer(), nullable=False)
    user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False)
Пример #2
0
class Fitness(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    exercisename = db.Column(db.String(100), nullable=False)
    duration = db.Column(db.Integer(), nullable=False)
    intensity = db.Column(db.String(100), nullable=False)
    calories = db.Column(db.Integer(), nullable=False)
    user_id = db.Column(db.Integer(), db.ForeignKey('user.id'), nullable=False)

    def __repr__(self):  #How objects are printed
        return f"Fitness('{self.name}', '{self.duration}')"
Пример #3
0
class Food(db.Model):
    __searchable__ = ['name']

    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    mass = db.Column(db.Integer(), nullable=False)
    calories = db.Column(db.Integer(), nullable=False)
    protein = db.Column(db.Integer(), nullable=False)
    carbohydrates = db.Column(db.Integer(), nullable=False)
    fats = db.Column(db.Integer(), nullable=False)

    def __repr__(self):  #How objects are printed
        return f"Food('{self.name}', '{self.mass}')"
Пример #4
0
class Fitness(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    duration = db.Column(db.Integer(), nullable=False)

    def __repr__(self):  #How objects are printed
        return f"Fitness('{self.name}', '{self.duration}')"
Пример #5
0
class Food(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    mass = db.Column(db.Integer(), nullable=False)

    def __repr__(self):  #How objects are printed
        return f"Food('{self.name}', '{self.mass}')"
Пример #6
0
class HealthTrack(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String(100), nullable=False)
    heartrate = db.Column(db.Integer(), nullable=False)