Skip to content

Instantly share code, notes, and snippets.

@kkellydesign
Last active October 27, 2015 19:59
Show Gist options
  • Save kkellydesign/b796cde8edacd43aa416 to your computer and use it in GitHub Desktop.
Save kkellydesign/b796cde8edacd43aa416 to your computer and use it in GitHub Desktop.
views.py
def by_location(request, location_slug):
doctors_list = Doctor.objects.filter(location__slug=location_slug)
location = Location.objects.get(slug=location_slug)
return render_to_response("doctors/location.html",
{"doctors_list": doctors_list},
{"location": location},
context_instance=RequestContext(request)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment