Skip to content

Instantly share code, notes, and snippets.

@DylanLukes
Created February 12, 2015 18:05
Show Gist options
  • Save DylanLukes/f741ffbbc8c784630131 to your computer and use it in GitHub Desktop.
Save DylanLukes/f741ffbbc8c784630131 to your computer and use it in GitHub Desktop.
from django import template
register = template.Library()
@register.assignment_tag(takes_context=True)
def get_page_extension(context):
return context['current_page'].epicpageextension
@register.assignment_tag(takes_context=True)
def get_title_extension(context):
return context['current_page']\
.title_set.get(language=context['LANGUAGE_CODE']) \
.epictitleextension
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment