本文整理汇总了Python中tagging.views.tagged_object_list函数的典型用法代码示例。如果您正苦于以下问题:Python tagged_object_list函数的具体用法?Python tagged_object_list怎么用?Python tagged_object_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tagged_object_list函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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)
开发者ID:exezaid,项目名称:Dpress,代码行数:10,代码来源:views.py
示例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)
开发者ID:ladyrassilon,项目名称:sarpaminfohub,代码行数:7,代码来源:views.py
示例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)
开发者ID:Lacrymology,项目名称:cmsplugin-blog,代码行数:7,代码来源:urls.py
示例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,
})
开发者ID:kikofernandez,项目名称:vLearnie,代码行数:32,代码来源:views.py
示例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)
开发者ID:elyezer,项目名称:souschef,代码行数:7,代码来源:tagged.py
示例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)
开发者ID:robbie,项目名称:anthill,代码行数:8,代码来源:views.py
示例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,})
开发者ID:dmeehan,项目名称:actionmanual,代码行数:8,代码来源:views.py
示例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
)
开发者ID:dancarroll,项目名称:dancarrollorg,代码行数:8,代码来源:views.py
示例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)
开发者ID:nsmgr8,项目名称:django-blogdor,代码行数:9,代码来源:views.py
示例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)
开发者ID:tinchou,项目名称:fiubar,代码行数:10,代码来源:views.py
示例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)
开发者ID:FuzzyFrequency,项目名称:django-blog-zinnia,代码行数:10,代码来源:tags.py
示例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,
},
)
开发者ID:Ryochan7,项目名称:djangopeople.net,代码行数:11,代码来源:views.py
示例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",
)
开发者ID:nek4life,项目名称:djangolicious,代码行数:11,代码来源:views.py
示例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')
开发者ID:lmorchard,项目名称:mdn,代码行数:11,代码来源:views.py
示例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))
开发者ID:gregplaysguitar,项目名称:glamkit-blogtools,代码行数:11,代码来源:views.py
示例16: tagged_links
def tagged_links(request,tag):
sort = request.GET.get('sort')
queryset=None
if sort in sort_by.keys():
queryset=Link.published.filter().order_by('%s' % sort_by[sort])
else:
queryset=Link.published.filter().order_by('-total_votes')
return tagged_object_list(request,queryset,tag,paginate_by=settings.RESULTS_PER_PAGE,allow_empty=True, template_object_name="object_list")
开发者ID:larisharis,项目名称:lovesupermarket,代码行数:12,代码来源:views.py
示例17: tagged_entry_list
def tagged_entry_list(self, request, *args, **kwargs):
if 'entry_queryset' in kwargs:
queryset = kwargs['entry_queryset']
del kwargs['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',
'paginate_by': self.paginate_by,
}
return tagged_object_list(request, *args, **dict(info_dict, **kwargs))
开发者ID:JudoWill,项目名称:glamkit-blogtools,代码行数:13,代码来源:views.py
示例18: country_skill
def country_skill(request, country_code, tag):
return tagged_object_list(request,
model = DjangoPerson,
tag = tag,
related_tags = True,
related_tag_counts = True,
extra_filter_args = {'country__iso_code': country_code.upper()},
template_name = 'skill.html',
extra_context = {
'api_key': settings.GOOGLE_MAPS_API_KEY,
'country': Country.objects.get(iso_code = country_code.upper()),
},
)
开发者ID:Ryochan7,项目名称:djangopeople.net,代码行数:13,代码来源:views.py
示例19: entries_tagged_with
def entries_tagged_with(request, tag, template_name="tags/entries_tagged_with.html"):
params = {
"queryset_or_model": get_latest_entries(),
"tag": tag,
"template_name": '%s/%s' % (settings.TEMPLATE_NAME, template_name),
"paginate_by": settings.ENTRIES_PER_PAGE,
"page": request.GET.get("page", 1),
"template_object_name": "entry",
# FIXME: the following line results as an AttributeError due to bug #179
# (http://code.google.com/p/django-tagging/issues/detail?id=179)
# "related_tags": True,
}
return tagged_object_list(request, **params)
开发者ID:tunix,项目名称:raptiye-django,代码行数:14,代码来源:views.py
示例20: tag_detail
def tag_detail(request, slug, template_name = 'book/book_list.html', **kwargs):
tag = str(slug).replace('-', ' ')
kwargs = {
'template_name':template_name,
'paginate_by':10,
'extra_context':{'content_title':'Books tagged with <i>"'+tag+'"</i>'}
}
return tagged_object_list(
request,
Book.objects.published(),
tag,
**kwargs
)
开发者ID:rpribadi,项目名称:flakeware,代码行数:14,代码来源:views.py
注:本文中的tagging.views.tagged_object_list函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论