import os
import sys
import transaction

from sqlalchemy import engine_from_config

from pyramid.paster import (
    get_appsettings,
    setup_logging,
    )

from ..models import (
    DBSession,
    Order,
    )

def usage(argv):
    cmd = os.path.basename(argv[0])
    print('usage: %s <config_uri>\n'
          '(example: "%s development.ini")' % (cmd, cmd))
    sys.exit(1)


def main(argv=sys.argv):
    if len(argv) != 2:
        usage(argv)
    config_uri = argv[1]
    setup_logging(config_uri)
    settings = get_appsettings(config_uri)
    engine = engine_from_config(settings, 'sqlalchemy.')
    DBSession.configure(bind=engine)
    with transaction.manager:
        order = Order('order_0001', 1)
        DBSession.add(order)
    orders = DBSession.query(Order).all()
    print len(orders)

@@ -665,16 +665,50 @@
 anager:%0A
+        for i in range(0,10):%0A    
         
@@ -726,24 +726,30 @@
 er('
-order_0001'
+exref_%25s' %25 i
 , 1)%0A
+    
     

Add a little bit of demo data to show what the list_orders view does