hero_slider.templatetags.hero_slider_tags: 7 total statements, 100.0% covered

Generated: Tue 2013-05-21 16:43 CEST

Source file: /home/dkaufhold/projects/django-hero-slider/src/hero_slider/templatetags/hero_slider_tags.py

Stats: 5 executed, 0 missed, 2 excluded, 13 ignored

  1. """Templatetags for the ``hero_slider`` app."""
  2. from django import template
  3. from hero_slider.models import SliderItem
  4. register = template.Library()
  5. @register.inclusion_tag('hero_slider/carousel.html', takes_context=True)
  6. def render_hero_slider(context):
  7. """
  8. Renders the hero slider.
  9. """
  10. req = context.get('request')
  11. qs = SliderItem.objects.published(req).order_by('position')
  12. return {
  13. 'slider_items': qs,
  14. }