I'm trying to filter information for a page by year and can't seem to
get the view to work correctly. The view below should get the list of
counties and years so that I can show detailed information for vendors
by year. The url seems to work but I get a page without vendor data.
Could anyone point me to what I might be doing wrong here?
here is the view:
def county_year(request, county, year):
c = get_object_or_404(County, slug=county)
vendors = Vendors.objects.filter(county=c)
y = get_object_or_404(Year, slug=year)
return render_to_response('county/county_year_detail.html',
{'county':c,
'vendor':vendors, 'year': year})
the url is here:
(r'^project/county/(?P<county>[-a-z]+)/(?P<year>\d+)/
$',county_year_detail),
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---