fix ups
This commit is contained in:
		@ -1351,7 +1351,6 @@ class LogQuerySet(models.QuerySet):
 | 
				
			|||||||
            logs = yaml.load(data)
 | 
					            logs = yaml.load(data)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            # we need to preload diffusions, sounds and tracks
 | 
					            # we need to preload diffusions, sounds and tracks
 | 
				
			||||||
            # we get them all at once, in order to reduce db calls
 | 
					 | 
				
			||||||
            rels = {
 | 
					            rels = {
 | 
				
			||||||
                'diffusion': self._get_rel_objects(logs, Diffusion, 'diffusion'),
 | 
					                'diffusion': self._get_rel_objects(logs, Diffusion, 'diffusion'),
 | 
				
			||||||
                'sound': self._get_rel_objects(logs, Sound, 'sound'),
 | 
					                'sound': self._get_rel_objects(logs, Sound, 'sound'),
 | 
				
			||||||
 | 
				
			|||||||
@ -811,8 +811,11 @@ class TimetablePage(DatedListPage):
 | 
				
			|||||||
    def get_queryset(self, request, context):
 | 
					    def get_queryset(self, request, context):
 | 
				
			||||||
        diffs = []
 | 
					        diffs = []
 | 
				
			||||||
        for date in context['nav_dates']['dates']:
 | 
					        for date in context['nav_dates']['dates']:
 | 
				
			||||||
            items = aircox.models.Diffusion.objects.at(self.station, date)
 | 
					            items = [
 | 
				
			||||||
            items = [ DiffusionPage.as_item(item) for item in items ]
 | 
					                DiffusionPage.as_item(item)
 | 
				
			||||||
 | 
					                for item in aircox.models.Diffusion.objects \
 | 
				
			||||||
 | 
					                                  .station(self.station).at(date)
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
            diffs.append((date, items))
 | 
					            diffs.append((date, items))
 | 
				
			||||||
        return diffs
 | 
					        return diffs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -489,8 +489,11 @@ class SectionTimetable(Section,DatedBaseList):
 | 
				
			|||||||
        from aircox_cms.models import DiffusionPage
 | 
					        from aircox_cms.models import DiffusionPage
 | 
				
			||||||
        diffs = []
 | 
					        diffs = []
 | 
				
			||||||
        for date in context['nav_dates']['dates']:
 | 
					        for date in context['nav_dates']['dates']:
 | 
				
			||||||
            items = aircox.models.Diffusion.objects.at(self.station, date)
 | 
					            items = [
 | 
				
			||||||
            items = [ DiffusionPage.as_item(item) for item in items ]
 | 
					                DiffusionPage.as_item(item)
 | 
				
			||||||
 | 
					                for item in aircox.models.Diffusion.objects \
 | 
				
			||||||
 | 
					                                  .station(self.station).at(date)
 | 
				
			||||||
 | 
					            ]
 | 
				
			||||||
            diffs.append((date, items))
 | 
					            diffs.append((date, items))
 | 
				
			||||||
        return diffs
 | 
					        return diffs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -5,7 +5,7 @@
 | 
				
			|||||||
{% if nav_dates.dates %}
 | 
					{% if nav_dates.dates %}
 | 
				
			||||||
<nav class="nav_dates">
 | 
					<nav class="nav_dates">
 | 
				
			||||||
    {% if target %}
 | 
					    {% if target %}
 | 
				
			||||||
    <a href="{{ target.url }}?date={{ nav_dates.today|date:"Y-m-d" }}" title="{% trans "go to today" %}">○</a>
 | 
					    <a href="{{ target.url }}?date={{ nav_dates.today|date:"Y-m-d" }}" title="{% trans "go to today" %}">●</a>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    {% if nav_dates.prev %}
 | 
					    {% if nav_dates.prev %}
 | 
				
			||||||
    <a href="{{ target.url }}?date={{ nav_dates.prev|date:"Y-m-d" }}" title="{% trans "previous days" %}">◀</a>
 | 
					    <a href="{{ target.url }}?date={{ nav_dates.prev|date:"Y-m-d" }}" title="{% trans "previous days" %}">◀</a>
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user