mirror of
				https://github.com/StefBuwalda/cal_counter.git
				synced 2025-10-29 19:00:00 +00:00 
			
		
		
		
	Renamed FoodItems to FoodItem and Units to Unit in models.py, updated related imports and usage throughout the codebase. Added a barcode scanner test page using ZXing in the admin section. Improved food_items.html to display nutritional information in a table. Registered the admin blueprint in app.py and cleaned up blueprint registration in __init__.py. Updated seed.py to use the new FoodItem model.
		
			
				
	
	
		
			15 lines
		
	
	
		
			412 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			412 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from flask import Flask
 | |
| from flask_login import LoginManager  # type: ignore
 | |
| from flask_sqlalchemy import SQLAlchemy
 | |
| from flask_migrate import Migrate
 | |
| 
 | |
| 
 | |
| app = Flask(__name__)  # Init Flask app
 | |
| app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///data.db"
 | |
| 
 | |
| 
 | |
| db = SQLAlchemy(app=app)  # Init SQLAlchemy
 | |
| migrate = Migrate(app=app, db=db)  # Init Migration
 | |
| 
 | |
| login_manager = LoginManager(app=app)  # Init login manager
 |