Hello. I have an application in which a list should be filtered
depending on what groups a user belongs, since the application is a
homework list, and the list must only contain the classes the user
(student) is enrolled.
I know I should do this using filter, but I have no idea how to get
the list of groups the current, logged in user is a member of, and
then making that into a filter. Anyone have any tips?
-----
def index(request):
object_list = Homework.objects.order_by('-duedate')[:100]
t = loader.get_template('homework/homework_list.html')
c = Context({
'object_list': object_list,
})
return HttpResponse(t.render(c))
-----
This is the relevant function, in which the latest 100 homework
entries are passed and then rendered by a template.
If anyone has any tips on how to do this filtering by user group, then
please do. Help is much appreciated at this point, considering I am a
newbie. :P
--
No violence, gentlemen -- no violence, I beg of you! Consider the furniture!
-- Sherlock Holmes
Gabriel Puliatti
predius.org
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---