Lino Website

Documentation · Modules · adamo · Examples

pizzeria1.py

This example does a simple query on the Pizzeria demo application.

Source code:

from lino.apps.pizzeria.pizzeria import Pizzeria, populate, Order

app = Pizzeria() 

dbc = app.createContext()
    
populate(dbc)

orders = dbc.query(Order,"customer totalPrice")

for o in orders:
    print "%s must pay %d EUR" % (o.customer.name, o.totalPrice)

del app, dbc, orders, o

Output:

Henri must pay 12 EUR
James must pay 53 EUR

See also: lino:src/lino/apps/pizzeria/pizzeria.py

Copyright 2001-2007 Luc Saffre.
http://lino.saffre-rumma.ee
Generated 2007-06-07 16:23:39