12 lines
328 B
Python
12 lines
328 B
Python
from lapp import create_app
|
|||
|
|
import sqlalchemy as sa
|
||
|
|
from models import db, Item
|
||
|
|
|
||
|
|
app = create_app()
|
||
|
|
app.app_context().push()
|
||
|
|
query = sa.select(Item) #.where(Item.quantity == 0)
|
||
|
|
items = db.session.scalars(query).all()
|
||
|
|
|
||
|
|
# items=Item.query.filter_by(quantity='').all()
|
||
|
|
for i in items:
|
||
|
|
print(f"{i.label} {i.quantity} {i.unit}")
|