Created
December 6, 2012 00:28
-
-
Save arruda/4220855 to your computer and use it in GitHub Desktop.
Django – Simple Template Tag Without a String as Argument
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@register.simple_tag(takes_context=True) | |
def current_time(context, format_string): | |
timezone = context['timezone'] | |
return your_get_current_time_method(timezone, format_string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@register.simple_tag(takes_context=True) | |
def current_time(context, format_string): | |
timezone = context['timezone'] | |
context['newVar'] = "Hi!" | |
return your_get_current_time_method(timezone, format_string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load polls_tags %} | |
{% get_userInfo_for_poll poll request.user %} | |
<p>Here's some info about this poll and user:{{ userInfo.someInfo }}</p> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment