Skip to content

Instantly share code, notes, and snippets.

@simahawk
Created October 14, 2011 10:10
Show Gist options
  • Save simahawk/1286732 to your computer and use it in GitHub Desktop.
Save simahawk/1286732 to your computer and use it in GitHub Desktop.
lfs template tag example
from django import template
register = template.Library()
import lfs.cart.utils
from lfs.core.models import Shop
from lfs.caching.utils import lfs_get_object_or_404
@register.inclusion_tag("lfs/disclaimer.html")
def disclaimer():
shop = lfs_get_object_or_404(Shop, pk=1)
return { 'shop':shop }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment