本文整理汇总了Python中tagging.views.tagged_object_list函数的典型用法代码示例。如果您正苦于以下问题:Python tagged_object_list函数的具体用法?Python tagged_object_list怎么用?Python tagged_object_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tagged_object_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: by_tag
def by_tag(request, tag, *args, **kwargs):
"""Post listing. Only shows posts that are older than now() and belongs to specified tags"""
queryset = Post.objects.filter(date__lte=dt.now())
if not kwargs.has_key('extra_context'):
kwargs['extra_context'] = {}
kwargs['extra_context']['feedurl'] = 'tag/%s' % tag
if '+' in tag:
return tagged_object_list(request, queryset, tag.split('+'), union=False, *args, **kwargs)
else:
return tagged_object_list(request, queryset, tag.split('|'), *args, **kwargs)
示例2: dehex_tagged_object_list
def dehex_tagged_object_list(request, queryset_or_model=None, tag=None,
related_tags=False, related_tag_counts=True):
dehexed = tag.decode('hex')
return tagged_object_list(request=request,
queryset_or_model=queryset_or_model,
tag=dehexed, related_tags=related_tags,
related_tag_counts=related_tag_counts)
示例3: blog_archive_tagged
def blog_archive_tagged(request, **kwargs):
blog_slug = kwargs.pop('blog_slug')
kwargs['queryset_or_model'] = (kwargs['queryset_or_model'].published()
.filter(blog__slug=blog_slug))
set_language_changer(request, language_changer)
return tagged_object_list(request, extra_context={ 'blog_slug': blog_slug },
**kwargs)
示例4: show_tagged_links_object_list
def show_tagged_links_object_list(request, username, spacename, tag):
"""
This view gives you the links that have been marked with the ``tag``
**Type:**
* public
**Arguments:**
* request: Request object
* username: string containing the username
* spacename: name of the space that you want to watch
* tag: tag to consult
**Template:**
* ``coltrane/entry_detail.html``
**Decorators:**
None
"""
l = Link.objects.filter(posted_by__username=username).filter(space__slug=spacename)
#l.filter(tags__icontains=tag)
tags = Tag.objects.select_related(depth=2).get(id=tag)
return tagged_object_list(request,
#queryset_or_model=l.filter(tags__icontains=tag),
queryset_or_model=l.filter(tags__icontains=tags.name),
tag = tags.name,
related_tags = False,
template_name='coltrane/links_by_tags.html',
extra_context={'username': username,
'spacename': spacename,
})
示例5: tagged_entry_list
def tagged_entry_list(request, *args, **kwargs):
"""
A thin wrapper around ``tagging.views.tagged_object_list``.
"""
if 'queryset_or_model' not in kwargs:
kwargs['queryset_or_model'] = Entry.published_on_site.all()
return tagged_object_list(request, *args, **kwargs)
示例6: tag_archive
def tag_archive(request, tag):
qs = Project.objects.select_related()
if hasattr(qs, '_gatekeeper'):
qs = qs.approved()
return tagged_object_list(request, qs, tag, paginate_by=10,
template_object_name='project',
extra_context={'tag':tag},
allow_empty=True)
示例7: ideas_by_tag
def ideas_by_tag(request, tag):
categories = Category.objects.all()
cities = Idea.published.values_list('city').distinct()
return tagged_object_list(tag,
queryset_or_model=Idea,
template_name='portfolio/ideas_by_tag.html',
extra_context={'categories': categories,
'cities': cities,})
示例8: tag_detail
def tag_detail(request, slug, template_name = 'blog/tag_detail.html', **kwargs):
return tagged_object_list(
request,
queryset_or_model = Entry.objects.published_for_list(),
tag = slug,
template_name = template_name,
**kwargs
)
示例9: tag
def tag(request, tag):
return tagged_object_list(
request,
Post.objects.published().select_related(),
tag,
paginate_by=POSTS_PER_PAGE,
template_object_name='post',
extra_context={'tag': tag},
allow_empty=True)
示例10: articles_by_tag
def articles_by_tag(request, *args, **kwargs):
"""Show articles matching selected tag"""
from tagging.views import tagged_object_list
kwargs.update({ 'template_object_name' : 'article',
'template_name' : 'articles/article_list.html',
'queryset_or_model' : Article.objects.published(),
'paginate_by': ARTICLES_PAGINATED_BY,
'page': request.GET.get('page', 1),
})
return tagged_object_list(request, **kwargs)
示例11: tag_detail
def tag_detail(request, tag, page=None, **kwargs):
"""Display the entries of a tag"""
if not kwargs.get('template_name'):
kwargs['template_name'] = template_name_for_entry_queryset_filtered(
'tag', slugify(tag))
return tagged_object_list(request, tag=tag,
queryset_or_model=Entry.published.all(),
paginate_by=PAGINATION, page=page,
**kwargs)
示例12: skill
def skill(request, tag):
return tagged_object_list(request,
model = DjangoPerson,
tag = tag,
related_tags = True,
related_tag_counts = True,
template_name = 'skill.html',
extra_context = {
'api_key': settings.GOOGLE_MAPS_API_KEY,
},
)
示例13: bookmark_tag_detail
def bookmark_tag_detail(request, tag):
queryset = Bookmark.shared_objects.all()
return tagged_object_list(
request,
queryset,
tag,
paginate_by=10,
allow_empty=True,
template_object_name="bookmark",
template_name="djangolicious/bookmark_list.html",
)
示例14: tag
def tag(request, tag):
sort_order = request.GET.get('sort', 'created')
queryset = Submission.objects.all_sorted(sort_order)\
.exclude(hidden=True)
return tagged_object_list(request,
queryset_or_model=queryset, tag=tag,
paginate_by=DEMOS_PAGE_SIZE, allow_empty=True,
template_loader=template_loader,
template_object_name='submission',
template_name='demos/listing_tag.html')
示例15: tagged_entry_list
def tagged_entry_list(self, request, entry_queryset=None, *args, **kwargs):
if entry_queryset is not None:
queryset = entry_queryset
else:
queryset = self.entry_queryset
info_dict = {
'queryset_or_model': queryset,
'template_name': '%s/tag_detail.html' % self.template_root_path,
'template_object_name': 'entry',
}
return tagged_object_list(request, *args, **dict(info_dict, **kwargs))