On Wed, 2009-02-18 at 23:35 -0800, Marlun wrote:
> I believe this will work perfectly in my case.
> 
> To easy my curiosity, how would you do it differently if you wanted
> the sequence object to be grouped by date but have the month name
> instead of number? I mean right now I get a list of entry objects. How
> would you change your view code to retrieve a sequense sorted by month
> name and year in the template?

The month or year are more presentation details than data retrieval
operations. You still sort the result set by date, which brings all the
entries for month X in a particular year together. Then, in your
template, you can format the display however you like (including using
the "ifchanged" template tag if you want to display some value only when
it changes).

Use the "date" template filter to format the results: if "obj" is a date
object, the {{ obj|date:"M" }} will display the month name in a
template.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@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
-~----------~----~----~----~------~----~------~--~---

Reply via email to