Source

dvd-collection / collection / templatetags / moviedb.py

1
2
3
4
5
6
7
8
9
from django import template
from collection.models import Movie

register = template.Library()

@register.inclusion_tag('collection/fragments/movie_posters.html')
def latest_movies():
    movie_list = Movie.objects.order_by('-added_on')[:9]
    return {'movie_list':movie_list, 'span':'4'}