Here is a small script for making CamelCase string in python
import re
from string import capitalize
def camelcase(value):
return "".join([capitalize(w) for w in re.split(re.compile("[\W_]*"), value)])
in django just add
@register.filter
making it
import re
from string import capitalize
@register.filter
def camelcase(value):
return "".join([capitalize(w) for w in re.split(re.compile("[\W_]*"), value)])
Hope it help.
saved my day, thanks!
Comment by tutuca — March 21, 2009 @ 7:42 am
Thanks for this post. I am new at development and this was a big help.
Comment by Jackie Vaught — March 7, 2010 @ 3:36 am