コード例 #1
0
ファイル: views.py プロジェクト: hmm/sct-communitytools
def show_tag_snips(request, group, tag_name):
    tag = Tag.objects.get( group = group, name__exact = tag_name )
    # OK .. we need to find all wiki snips in the current group on which the 
    # user has permission to view.
    snips = tag_get_models_by_tag(WikiSnip.objects.all(), tag)

    return object_list( request = request,
                        queryset = snips,
                        template_name = 'sphene/sphwiki/list_tag_snips.html',
                        extra_context = { 'tag_name': tag_name,
                                          },
                        allow_empty = True,
                        )
コード例 #2
0
def show_tag_snips(request, group, tag_name):
    tag = Tag.objects.get(group=group, name__exact=tag_name)
    # OK .. we need to find all wiki snips in the current group on which the
    # user has permission to view.
    snips = tag_get_models_by_tag(WikiSnip.objects.all(), tag)

    return object_list(
        request=request,
        queryset=snips,
        template_name='sphene/sphwiki/list_tag_snips.html',
        extra_context={
            'tag_name': tag_name,
        },
        allow_empty=True,
    )
コード例 #3
0
ファイル: views.py プロジェクト: sunilpatelmca/dishnine
def show_tag_posts(request, group, tag_name):
    categories = get_board_categories(group)

    if not categories:
        return render_to_response( 'sphene/sphblog/nocategory.html',{},
                                   context_instance = RequestContext(request) )

    tag = get_object_or_404(Tag, group = group,
                            name__exact = tag_name )
    threads = get_posts_queryset(group, categories)
    threads = tag_get_models_by_tag( threads, tag )

    return render_to_response( 'sphene/sphblog/blogindex.html',
                               { 'threads': threads,
                                 'tag': tag,
                                 },
                               context_instance = RequestContext(request) )
コード例 #4
0
ファイル: views.py プロジェクト: hpoul/sct-communitytools
def show_tag_posts(request, group, tag_name, page = 1):
    categories = get_board_categories(group)

    if not page:
        page = 1

    if not categories:
        return render(request, 'sphene/sphblog/nocategory.html')

    tag = get_object_or_404(Tag, group = group,
                            name__exact = tag_name )
    threads = get_posts_queryset(group, categories)
    threads = tag_get_models_by_tag( threads, tag )
    paged_threads = get_paged_objects(threads, page)

    return render(request, 'sphene/sphblog/blogindex.html',
                  { 'threads': paged_threads,
                    'tag': tag,
                    'group': group,
                    'categories': categories,
                    })
コード例 #5
0
def show_tag_posts(request, group, tag_name, page=1):
    categories = get_board_categories(group)

    if not page:
        page = 1

    if not categories:
        return render(request, 'sphene/sphblog/nocategory.html')

    tag = get_object_or_404(Tag, group=group, name__exact=tag_name)
    threads = get_posts_queryset(group, categories)
    threads = tag_get_models_by_tag(threads, tag)
    paged_threads = get_paged_objects(threads, page)

    return render(
        request, 'sphene/sphblog/blogindex.html', {
            'threads': paged_threads,
            'tag': tag,
            'group': group,
            'categories': categories,
        })
コード例 #6
0
 def get_queryset(self):
     return tag_get_models_by_tag(WikiSnip.objects.all(), self.tag)