Source

dvd-collection / collection / templatetags / moviedb.py

Full commit
Kevin Veroneau 80dc35b 








Kevin Veroneau e145dfb 


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'}

@register.simple_tag
def total_movies():
    return Movie.objects.all().count()