На данный момент есть такой код
#show.html {% for showtime in showtimes %} <div class="row"> <div class="medium-11 medium-centered columns"> <div class="panel callout radius"> Кинотеатр: {{ showtime.showtime_place }}<br> Дата: {{ showtime.showtime_dates }}<br> Время: {{ showtime.showtime_times }}<br> Формат: {{ showtime.showtime_format }}<br> </div> </div> </div> {% endfor %}


Подскажите, как сделать так, чтоб вывод был как тут http://vkino.com.ua/show/3667/?city=kiev#!=&cinema=&date=
т.е группировка по Кинотеатру, потом подгруппировка по дате?
#models.py class Showtime(models.Model): showtime_dates = models.CharField('Date', max_length=30) showtime_times = models.CharField('Time', max_length=30) showtime_format = models.CharField('Format', max_length=4, blank=True) showtime_place = models.ForeignKey('app_places.place', verbose_name='Place') showtime_show = models.ForeignKey(Show, verbose_name='Show name')
#views.py def show(request, show_id=1): return render_to_response('app_shows_and_times/show.html', {'show': Show.objects.get(id=show_id), 'showtimes': Showtime.objects.filter(showtime_show_id=show_id)})
Формат записей в БД в подобном виде
ID…|……………..Date………………|…….Time | Format | showtime_place_id | showtime_show_id
122,“30 августа, сегодня”, .|……19:00,…..2D,…………………2,…………………….5
123,“30 августа, сегодня”, .|……23:20,…..2D,…………………2,…………………….5
124,“31 августа, понедельник”,|.12:20,…..2D,…………………2,…………………….5
125,“31 августа, понедельник”,|.17:00,…..2D,…………………2,…………………….5
Пробовал применить regroup, по аналогии с примером из документации
{% regroup showtimes by showtime.showtime_place as cinema_place %} <ul> {% for showtime.showtime_place in cinema_place %} <li> {{ showtime.showtime_place.grouper }} <ul> {% for item in showtime.showtime_place.list %} <li> {{ item.showtime.showtime_dates }}: {{ item.showtime.showtime_times }} </li> {% endfor %} </ul> </li> {% endfor %} </ul>