def page_pagination(context, category=None, page=1, prefix=None, app_name=None): if category: return "%s?category=%s&page=%s" % (reverse(context['request'], prefix, app_name, 'news-index'), category, page) else: return "%s?page=%s" % (reverse(context['request'], prefix, app_name, 'news-index'), page)
def newsitem_url(context, slug, prefix=None, app_name=None,): return reverse(context['request'], prefix, app_name, 'news-detail', kwargs={ 'slug': slug})
def newscategory_url(context, get, prefix=None, app_name=None): return "%s?category=%s" % (reverse(context['request'], prefix, app_name, 'news-index'), get)
def newsindex_url(context, prefix=None, app_name=None,): return reverse(context['request'], prefix, app_name, 'news-index')