Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Arpaso/django-banner-simple
base: 4bd095c990
...
head fork: Arpaso/django-banner-simple
compare: a9388250ab
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 1 file changed
  • 0 commit comments
  • 2 contributors
Commits on Jul 20, 2014
@hecrogon hecrogon banner_tags as a inclusion tag a2bdf96
Commits on Jul 21, 2014
@Arvi3d Arvi3d Merge pull request #4 from hecrogon/bannertags
banner_tags as a inclusion tag
a938825
Showing with 8 additions and 8 deletions.
  1. +8 −8 src/banner/templatetags/banner_tags.py
View
16 src/banner/templatetags/banner_tags.py
@@ -1,16 +1,16 @@
### -*- coding: utf-8 -*- ####################################################
from django.conf import settings
-from native_tags.decorators import function
+from django import template
+from banner.models import Banner
-from ..models import Banner
+register = template.Library()
+@register.inclusion_tag('banner_source.html')
def get_banner(slug, width, height, queryset=Banner.objects.all()):
banner = queryset.get_or_create(slug=slug.encode('utf-8'))[0]
- return "banner_source.html", {
- 'banner': banner, 'size': "%ix%i" % (width, height),
- 'width': width, 'height': height,
- 'STATIC_URL': settings.STATIC_URL,
+ return {
+ 'banner': banner, 'size': "%ix%i" % (width, height),
+ 'width': width, 'height': height,
+ 'STATIC_URL': settings.STATIC_URL,
}
-
-get_banner = function(get_banner, inclusion=True, cache=60)

No commit comments for this range

Something went wrong with that request. Please try again.