<filename>www/test_orm.py
# -*- coding: utf-8 -*-

import orm
import asyncio
from models import User, Blog, Comment

async def test(loop):
    await orm.create_pool(loop=loop, user='root', password='<PASSWORD>', db='awesome')

    u = User(name='Test1', email='<EMAIL>', passwd='<PASSWORD>', image='about:blank')

    await u.save()

loop = asyncio.get_event_loop()
loop.run_until_complete(test(loop))

print('插入成功')

<filename>www/test_orm.py
# -*- coding: utf-8 -*-

import orm
import asyncio
from models import User, Blog, Comment

async def test(loop):
    await orm.create_pool(loop=loop, user='root', password='<PASSWORD>', db='awesome')

    u = User(name='Test1', email='<EMAIL>', passwd='<PASSWORD>', image='about:blank')

    await u.save()

loop = asyncio.get_event_loop()
loop.run_until_complete(test(loop))

print('插入成功')

# -*- coding: utf-8 -*-