ogn-python/ogn/commands/showairport.py

17 wiersze
354 B
Python
Czysty Zwykły widok Historia

2016-05-22 05:20:29 +00:00
from ogn.model import Airport
from ogn.commands.dbutils import session
from manager import Manager
manager = Manager()
@manager.command
def list_all():
"""Show a list of all airports."""
query = session.query(Airport) \
.order_by(Airport.name)
print('--- Airports ---')
for airport in query.all():
print(airport.name)