Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)

src/h/a/hansonsblog-HEAD/hansonsblog/sblog/views.py   hansonsblog(Download)
 
    categories = Category.objects.all()
    tags = Tag.objects.all()
    # 访客数据采集
    try:
def blog_show(request,slug):
    try:
        blog = Blog.objects.get(slug=slug)
        categories = Category.objects.all()
        tags = Tag.objects.all()
def category(request,slug):
    cut_category = get_object_or_404(Category,slug=slug)
    blogs = cut_category.blog_set.all() #查找符合条件的所有文章  #Blog.objects.filter(category=cut_category)
    categories = Category.objects.all()
    tags = Tag.objects.all()
def tag(request,id=''):
    cut_tag = Tag.objects.get(id=id)
    blogs =cut_tag.blog_set.all() #查找符合条件的所有文章
    tags = Tag.objects.all()
    categories = Category.objects.all()