from aiohttp import web
from app.Model.Page import Page
import aiohttp_jinja2

@aiohttp_jinja2.template('index/page/detail.html')
async def detail(request, **k):
    data = dict()
    id = request.match_info['id'].split('.')[0]
    filters = {
        Page.filename == id,
        Page.delete_time == 0
    }
    post = Page().getOne(filters, Page.add_time.desc())
    data['post'] = post
    return data