from django.views.generic.list import ListView
from django.views.generic.detail import DetailView

from .models import UserProfile


class UserProfileBase(object):
    model = UserProfile


class UserProfileList(UserProfileBase, ListView):
    pass


class UserProfileDetail(UserProfileBase, DetailView):
    pass

from django.views.generic.list import ListView
from django.views.generic.detail import DetailView

from .models import UserProfile


class UserProfileBase(object):
    queryset = UserProfile.objects.all().select_related('user')


class UserProfileList(UserProfileBase, ListView):
    pass


class UserProfileDetail(UserProfileBase, DetailView):
    pass

Make sure the 'user' object is available in the UserProfile queryset in the view.
Make sure the 'user' object is available in the UserProfile queryset in the view.

  from django.views.generic.list import ListView
  from django.views.generic.detail import DetailView
  
  from .models import UserProfile
  
  
  class UserProfileBase(object):
-     model = UserProfile
+     queryset = UserProfile.objects.all().select_related('user')
  
  
  class UserProfileList(UserProfileBase, ListView):
      pass
  
  
  class UserProfileDetail(UserProfileBase, DetailView):
      pass
  
Make sure the 'user' object is available in the UserProfile queryset in the view.
## Code Before:
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView

from .models import UserProfile


class UserProfileBase(object):
    model = UserProfile


class UserProfileList(UserProfileBase, ListView):
    pass


class UserProfileDetail(UserProfileBase, DetailView):
    pass

## Instruction:
Make sure the 'user' object is available in the UserProfile queryset in the view.
## Code After:
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView

from .models import UserProfile


class UserProfileBase(object):
    queryset = UserProfile.objects.all().select_related('user')


class UserProfileList(UserProfileBase, ListView):
    pass


class UserProfileDetail(UserProfileBase, DetailView):
    pass
