Hello,
I've set up a user profile according to
this and now I'm trying to access the id of the currently logged in user in my urls.py, like this:
# urls.py
from django.contrib.auth.decorators import login_required
from django.views.generic import list_detail
from myproj.myapp.models import App1
app1_info = {
'queryset': App1.objects.filter(employee=????????)),
'template_name': 'template.html',
}
urlpatterns = patterns('',
(r'^logged_in/$', login_required(list_detail.object_list), app1_info),
)
In App1 I have a OneToOneField to my user profile, I want to list everything in App1 filtered on the currently logged in user (employee = current_user).
Every example I find in the docs uses the request.user.username, but I have no request method here.
Any clues?