All pastes #350229 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-02-11 09:06 UTC
rendered paste body
from django.template import Context, loader                                                                                  
from django.http import HttpResponse                                                                                         
                                                                                                                             
from chris.travel.models import Travel, Country                                                                              
                                                                                                                             
def index(request):                                                                                                          
    travel_list = Travel.objects.all().order_by('-travel_date')                                                                  country_list = Country.objects.all()                                                                                     
    t = loader.get_template('travel/index.html')                                                                                 c = Context({                                                                                                            
            'travel_list': travel_list,                                                                                      
            'country_list': country_list,                                                                                    
    })                                                                                                                       
    return HttpResponse(t.render(c))