예제 #1
0
파일: admin.py 프로젝트: geekone/pyweb
def initdata():
    cate1 = Category(name='category1')
    cate1.store()
    cate2 = Category(name='category2')
    cate2.store()
    shop1 = Shop(title="shop1",addr="shop1 addr",star=1)
    shop1.store()
    shop2 = Shop(title="shop2",addr="shop2 addr",star=2)
    shop2.store()
    shop3 = Shop(title="shop3",addr="shop3 addr",star=3)
    shop3.store()

    user1 = User(username="******",password="******",nickname="Test1",level=0)
    user1.store()
    user2 = User(username="******",password="******",nickname="Test2",level=0)
    user2.store()
    user3 = User(username="******",password="******",nickname="Test3",level=0)
    user3.store()
    user4 = User(username="******",password="******",nickname="Test4",level=0)
    user4.store()


#    ls = Category.all()
#    for l in ls:
#        print l.name
#    page = paginate(Signature.all(), 5, request.args.get('start'))
#    print page
    return render_template('admin/shops.html')
예제 #2
0
파일: admin.py 프로젝트: geekone/pyweb
def shops():
    try:
        _shop_results = Shop.all()
    except Exception,e:
        current_app.logger.error(e)