I have read this, but I have one more question: how I can rename country.grouper in the template? I ‘group’ week days – week_days.grouper, its like 1, 2, 3 etc. But I want change it in the template – Sunday, Monday etc. How to do it?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A custom template tag should help you out here. It has to be put into a file e.g.
my_custom_filters.pyin your app in a folder called templatetags:This custom filter will be used like this:
If you are using a date object could use the build-in date template tag to convert a date to the corresponding weekday: