def search(): filters = dict() q = request.args.get('q') writer = request.args.get('writer') # TODO: tag = request.args.get('tag') if q is not None: filters['q'] = q if writer is not None: filters['writer'] = writer filters['is_publish'] = True articles = Article.find_all(filters) return render_template('articles/search.html', filters=filters, articles=articles)
def list_all(): return render_template('articles/management.html', articles=Article.find_all())