I am trying to display a list of the users. once you select the user you can view the userprofile. the thing is: UserProfile does not work. how to make it works?
#views.py
class UserList(ListView):
model = Userx
template_name ='userList.html'
class UserProfile(ListView):
template_name = 'userprofile.html'
def get_context_data(self, **kwargs):
self.user= get_object_or_404(Userx, name=self.args[0])
return Userx.objects.filter(user=self.user)
#urls.py
url(r'^userprofile/(?P<id>\d+)/$', UserProfile.as_view(), name='userprofile'),