from django.views.generic import DetailView, ListView
from lab_members.models import Scientist

class ScientistListView(ListView):
    model = Scientist
    queryset = Scientist.objects.all()

class ScientistDetailView(DetailView):
    model = Scientist

from django.views.generic import DetailView, ListView
from lab_members.models import Scientist

class ScientistListView(ListView):
    model = Scientist

    def get_context_data(self, **kwargs):
        context = super(ScientistListView, self).get_context_data(**kwargs)
        context['scientist_list'] = Scientist.objects.filter(current=True)
        context['alumni_list'] = Scientist.objects.filter(current=False)
        return context

class ScientistDetailView(DetailView):
    model = Scientist

Return both scientist_list and alumni_list for ScientistListView
Return both scientist_list and alumni_list for ScientistListView

  from django.views.generic import DetailView, ListView
  from lab_members.models import Scientist
  
  class ScientistListView(ListView):
      model = Scientist
-     queryset = Scientist.objects.all()
+ 
+     def get_context_data(self, **kwargs):
+         context = super(ScientistListView, self).get_context_data(**kwargs)
+         context['scientist_list'] = Scientist.objects.filter(current=True)
+         context['alumni_list'] = Scientist.objects.filter(current=False)
+         return context
  
  class ScientistDetailView(DetailView):
      model = Scientist
  
Return both scientist_list and alumni_list for ScientistListView
## Code Before:
from django.views.generic import DetailView, ListView
from lab_members.models import Scientist

class ScientistListView(ListView):
    model = Scientist
    queryset = Scientist.objects.all()

class ScientistDetailView(DetailView):
    model = Scientist

## Instruction:
Return both scientist_list and alumni_list for ScientistListView
## Code After:
from django.views.generic import DetailView, ListView
from lab_members.models import Scientist

class ScientistListView(ListView):
    model = Scientist

    def get_context_data(self, **kwargs):
        context = super(ScientistListView, self).get_context_data(**kwargs)
        context['scientist_list'] = Scientist.objects.filter(current=True)
        context['alumni_list'] = Scientist.objects.filter(current=False)
        return context

class ScientistDetailView(DetailView):
    model = Scientist
