Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (12 sloc) 449 Bytes
from django import template
from geonode.layers.models import TopicCategory
from geonode.documents.models import Document
register = template.Library()
@register.assignment_tag(takes_context=True)
def featured_layers(context, count=7):
request = context["request"]
documents = Document.objects.order_by("-date")[:count]
return documents
@register.assignment_tag
def document_categories():
return TopicCategory.objects.all()
Jump to Line
Something went wrong with that request. Please try again.