Exemple #1
0
def admin_page(request, id=None):
    tags = TagService.list(limit=None)
    cats = CategoryService.list(model_name='CategoryModel', limit=None)
    article = {}
    if id:
        article = ArticleService.getByHashKey('ArticleModel', id)

    return render(request, 'admin/page.html', {
        'article': article,
        'cats': cats['data'],
        'tags': tags['data']
    })
Exemple #2
0
def page(request, id=0):
    article = ArticleService.getByHashKey('ArticleModel', id)
    cats = CategoryService.list(model_name='CategoryModel', limit=None)
    tags = TagService.list(model_name='TagModel', limit=None)
    return render(request, 'mysite/page.html', {'article' : article, 'cats': cats['data'], 'tags': tags['data']})