Esempio n. 1
0
def index(request, template_name="sodes/index.html"):
    """ 
    Published episode list
    """
    episodes = Sode.objects.filter(date__lte=datetime.now(), mp3__isnull=False)
    
    if use_paginator():
        episodes = make_paginator(request, episodes)
    
    return render_to_response(template_name, {"episodes": episodes}, context_instance=RequestContext(request))
Esempio n. 2
0
def archive(request, year, month, template_name="sodes/archive.html"):
    """
    List of published episodes, by year/month
    """
    episodes = Sode.objects.filter(
        date__lte=datetime.now(),
        date__year=year,
        date__month=month,
        mp3__isnull=False
    )
    
    if use_paginator():
        episodes = make_paginator(request, episodes)
    
    return render_to_response(template_name, {
            'episodes': episodes,
            'archive_date': date(int(year), int(month), 1)
        },
        context_instance=RequestContext(request)
    )