from django import template
from blanc_basic_news.news.models import Category, Post

register = template.Library()


@register.assignment_tag
def get_news_categories():
    return Category.objects.all()


@register.assignment_tag
def get_news_months():
    return Post.objects.dates('date', 'month')

@@ -21,16 +21,50 @@
 emplate%0A
+from django.utils import timezone%0A
 from bla
@@ -327,8 +327,182 @@
 month')%0A
+%0A%0A@register.assignment_tag%0Adef get_latest_news(count):%0A        return Post.objects.select_related().filter(%0A                published=True, date__lte=timezone.now())%5B:count%5D%0A

Add a template tag to get the latest news posts.