def tag_blogs(request, tag_name): try: tag = Tag.objects.get(tag_name=tag_name) blogs = tag.blog_set.all() pages, blogs = getPages(request, blogs) return blog_list_show(request, pages, blogs) except Exception: raise Http404
def tag_articles(request, tag_name): try: tag = Tag.objects.get(tag_name=tag_name) articles = tag.article_set.all() pages, articles = getPages(request, articles) return article_list_show(request, pages, articles) except Exception: raise Http404
def search_blog(request): try: wd = request.GET['wd'] if not wd: return HttpResponseRedirect(reverse('blog:blog_index')) blogs = Blog.objects.filter(caption__icontains=wd) pages, blogs = getPages(request, blogs) return blog_list_show(request, pages, blogs) except Exception: raise Http404
def search_article(request): try: wd = request.GET['wd'] if not wd: return HttpResponseRedirect(reverse('sonata:article_index')) articles = Article.objects.filter(caption__icontains=wd) pages, articles = getPages(request, articles) return article_list_show(request, pages, articles) except Exception: raise Http404
def blog_index(request): """ 显示博客的列表 """ blogs = Blog.objects.all() pages, blogs = getPages(request, blogs) return blog_list_show(request, pages, blogs)
def recommend_blogs(request): blogs = Blog.objects.filter(recommend=True) pages, blogs = getPages(request, blogs) return blog_list_show(request, pages, blogs)
def article_index(request): """ 显示文章的列表 """ articles = Article.objects.all() pages, articles = getPages(request, articles) return article_list_show(request, pages, articles)
def recommend_articles(request): articles = Article.objects.filter(recommend=True) pages, articles = getPages(request, articles) return article_list_show(request, pages, articles)