Files
cal_counter/seed.py
Stef e00bfee948 Refactor food item nutrition field names for consistency
Standardized field names for nutritional values in FoodItem model and throughout the codebase, changing 'fats_100g' to 'fat_100', 'saturated_fats_100g' to 'saturated_fat_100', and similar updates for other fields. Updated all references in models, templates, routes, and seed data to match the new naming convention for improved clarity and consistency.
2025-06-29 16:36:05 +02:00

25 lines
613 B
Python

from application import db, app
from models import User, FoodItem
with app.app_context():
User.query.delete()
db.session.add(User(username="admin", password="admin", is_admin=True))
db.session.add(User(username="user", password="user", is_admin=False))
FoodItem.query.delete()
db.session.add(
FoodItem(
name="AH Matcha cookie",
owner_id=1,
energy=430,
fat=19,
carbs=59,
protein=5.5,
saturated_fat=10,
sugar=35,
barcode=2278012003502,
)
)
db.session.commit()