Exemplo n.º 1
0
def tag_detail(request, tag, page=None, **kwargs):
    """Display the objecttypes of a tag"""
    if not kwargs.get('template_name'):
        kwargs['template_name'] = template_name_for_objecttype_queryset_filtered(
            'tag', slugify(tag))

    return tagged_object_list(request, tag=tag,
                              queryset_or_model=Objecttype.published.all(),
                              paginate_by=PAGINATION, page=page,
                              **kwargs)
Exemplo n.º 2
0
def author_detail(request, username, page=None, **kwargs):
    """Display the objecttypes of an author"""
    extra_context = kwargs.pop('extra_context', {})

    author = get_object_or_404(Author, username=username)
    if not kwargs.get('template_name'):
        kwargs['template_name'] = template_name_for_objecttype_queryset_filtered(
            'author', author.username)

    extra_context.update({'author': author})
    kwargs['extra_context'] = extra_context

    return object_list(request, queryset=author.objecttypes_published(),
                       paginate_by=PAGINATION, page=page,
                       **kwargs)
Exemplo n.º 3
0
def metatype_detail(request, path, page=None, **kwargs):
    """Display the objecttypes of a metatype"""
    extra_context = kwargs.pop('extra_context', {})

    metatype = get_metatype_or_404(path)
    if not kwargs.get('template_name'):
        kwargs['template_name'] = template_name_for_objecttype_queryset_filtered(
            'metatype', metatype.slug)

    extra_context.update({'metatype': metatype})
    kwargs['extra_context'] = extra_context

    return object_list(request, queryset=metatype.objecttypes_published(),
                       paginate_by=PAGINATION, page=page,
                       **kwargs)