Пример #1
0
    def GET(self, catslug, pgno=1):
        cat = get_category_by_slug(catslug)
        pagination = Pagination(info_record_query2(cat.id), info_count_query2(cat.id), pgno)
        qs = pagination.queryset
        entities = qs.all()

        # import pdb
        # pdb.set_trace()

        category_ancestors = get_category_ancestors(cat)

        req = web.ctx.req
        req.update(
            {
                "entities": entities,
                "category_ancestors": category_ancestors,
                "thecat": cat,
                "pagination": pagination,
                "get_latest_entities": get_latest_entities,
            }
        )

        template = cat.template and cat.template.list_file or None
        if not template or not template_exist(template):
            template = web.config.default_category_list
        return info_render.render(template, **req)
Пример #2
0
def get_entitys_category_ancestors(entity):
    return get_category_ancestors(entity.categories[0])
Пример #3
0
def get_entitys_category_ancestors(entity):
    return get_category_ancestors(entity.categories[0])