Not sure what happened, but I fixed this by doing this: {% regroup event_list by date.date as events %} {% for event in grouped %} <h2>{{ event.grouper|date:"l jS F" }}</h2> {% for event in events.list %} {{ event.title }} {% endfor %} {% endfor %}
On Jun 22, 1:01 pm, Darthmahon <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to group a list of events using the regroup template tag > as such: > > {% regroup event_list by date as events %} > > {% for event in events %} > <h2>{{ event.grouper.day }}</h2> > {% for event in events.list %} {{ event.title }} {% endfor %} > {% endfor %} > > Now, in my model for Events, I am using a datetime field so when I do > the regroup, unless the events are EXACTLY the same time, they will > print seperate H2's. > > Using the code above it looks like this: > > Saturday 22nd > - Event 1 > > Saturday 22nd > - Event 2 > > I want it to look like this: > > Saturday 22nd > - Event 1 > - Event 2 > > Any ideas? I know it has something to do with the datetime field > having the date and time, I just want it to have the date so I can > regroup on that. > > Cheers, > Chris --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---