I want to do something like this (from my urls.py), but I don’t know if it’s possible to get the user making the request:
url(r'^jobs/(page(?P<page>[0-9]+)/)?$',
object_list, {'queryset': Job.objects.filter(user=request.user),
'template_name': 'shootmpi/molecule_list.html'},
name='user_jobs'),
You can write a wrapper function that calls object_list with the required queryset.
In urls.py:
In views.py:
There’s a good blog post by James Bennett on using this technique.