Created
May 18, 2011 10:25
-
-
Save toast38coza/978332 to your computer and use it in GitHub Desktop.
Jiminy cricket! A fun exclamation filter for django
This file contains 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
from django import template | |
from django.conf import settings | |
from random import choice | |
register = template.Library() | |
#usage: {{explamation}}! A fun exclamation filter for django | |
@register.filter(name="exclamation") | |
def exclamation(punctuation): | |
exclamations = getattr(settings,"EXCLAMATIONS",False) | |
if not exclamations: | |
exclamations = [ | |
"jumping jack rabits", | |
"jiminy cricket", | |
"crikey", | |
"good lord", | |
"sweet mother of god", | |
"what the what", | |
"hell's teeth", | |
"hell's bells", | |
"what the devil" | |
] | |
return "%s%s"%(choice(exclamations),punctuation) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
National Fantasy Cricket Championship Nfcc Concludes On A Excessive Observe, Aakansha Gupta From Madhya Pradesh Topped The First Neteller operates nearly the identical way as Skrill; however, the charges are a little less and more reasonably priced. Neteller users can deposit 4raBet by entering their Neteller ID and safety code