def get(self, id): post = Post.objects.get_or_404(id=id) Post.objects(id=id).update_one(inc__views=1) return render_template('posts/detail.html', post=post, Markdown=Markdown, gen_author=gen_author, gen_author_name=gen_author_name, short_timesince=short_timesince)
def get(self, slug): category = Category.objects.get_or_404(_slug=slug) posts = Post.objects.filter( category=category ).order_by("-recent_activity_time") return render_template('categories/detail.html', category=category.name, posts=posts)
def get(self): url = request.args.get('url', '') url_pattern = url.rsplit('/', 1)[0] keyboards = KEYBOARD_URL_MAPS['default'] if url_pattern in KEYBOARD_URL_MAPS: keyboards += KEYBOARD_URL_MAPS[url_pattern] columns = zip(*[iter(keyboards)] * 2) return render_template('widgets/keyboard.html', columns=columns)
def get(self): url = request.args.get('url', '') url_pattern = url.rsplit('/', 1)[0] keyboards = KEYBOARD_URL_MAPS['default'] if url_pattern in KEYBOARD_URL_MAPS: keyboards += KEYBOARD_URL_MAPS[url_pattern] columns = zip(*[iter(keyboards)] * 2) return render_template( 'widgets/keyboard.html', columns=columns )
def get(self): posts = get_all_posts() return render_template('index.html', posts=posts)
def get(self): return render_template('user/settings.html', user=current_user)
def forbidden_page(error): return render_template('403.html'), 403
def not_found_page(error): return render_template('404.html'), 404
def profile(): return render_template("security/accounts/profile.html")
def profile(): return render_template('security/accounts/profile.html')