I know I'm in the minority, but I'm still having some trouble grokking
the details of generic views. I keep thinking I should be using them
but keep running into the same issue.

Here's my problem: I am building a mgmt site for schools in which
schools sign up for a monthly service fee. Most of my models have a
"school" foreign key which is also part of the user's profile.

So to see, for example, a list of teachers, I do something kind of
like this (assumes login has already occurred):

def myview(request):
   current_person = request.user.get_profile()
   current_school = current_person.school
   teacher_list = Teacher.objects.filter(school=current_school)
   etc

Almost everything I have has this school property.

My question is this: How do I leverage generic views in this capacity?
Is there a way to use the request information (specifically
request.user.get_profile().school in my case) in my urls.py when
generating my querysets?

Thank you!

Keyton
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to