On 23/01/2010 11:12am, Patrick wrote:
Hello All,
I'm sorry for being a newbe and posting this site, but I'm desperate.
I inherited a django site and when posts are added through the admin
page they render like this:
http://website/posts/category/2010/1/11/post_information/
but the link will only work if you add the leading zero to make it
look like this:
In the view called, extract the value which might need the leading zero
(day and/or month) and give it one like this ...
def leadzero(val):
"""converts any val to a string"""
mth = '00%s' % val
# return the last 2 chars
return mth[-2:]
http://website/posts/category/2010/01/11/post_information/
Would any of you be kind enough to point me in the right direction to
resolve this?
thank you in advance,
patrick
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.