from django.views.generic import View

from nap.datamapper.models import ModelDataMapper
from nap.rest import views

from .models import Poll


class PollMapper(ModelDataMapper):
    class Meta:
        model = Poll
        fields = ['question', 'pub_date']


class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.ObjectMixin, View):
    model = Poll
    mapper_class = PollMapper

from django.views.generic import View

from nap.datamapper.models import ModelDataMapper
from nap.rest import views

from .models import Poll


class PollMapper(ModelDataMapper):
    class Meta:
        model = Poll
        fields = ['question', 'pub_date']


class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.BaseObjectView):
    model = Poll
    mapper_class = PollMapper

Update test to use Base view
Update test to use Base view

  from django.views.generic import View
  
  from nap.datamapper.models import ModelDataMapper
  from nap.rest import views
  
  from .models import Poll
  
  
  class PollMapper(ModelDataMapper):
      class Meta:
          model = Poll
          fields = ['question', 'pub_date']
  
  
- class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.ObjectMixin, View):
+ class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.BaseObjectView):
      model = Poll
      mapper_class = PollMapper
  
Update test to use Base view
## Code Before:
from django.views.generic import View

from nap.datamapper.models import ModelDataMapper
from nap.rest import views

from .models import Poll


class PollMapper(ModelDataMapper):
    class Meta:
        model = Poll
        fields = ['question', 'pub_date']


class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.ObjectMixin, View):
    model = Poll
    mapper_class = PollMapper

## Instruction:
Update test to use Base view
## Code After:
from django.views.generic import View

from nap.datamapper.models import ModelDataMapper
from nap.rest import views

from .models import Poll


class PollMapper(ModelDataMapper):
    class Meta:
        model = Poll
        fields = ['question', 'pub_date']


class SinglePollView(views.ObjectGetMixin, views.ObjectPutMixin, views.ObjectPatchMixin, views.ObjectDeleteMixin, views.BaseObjectView):
    model = Poll
    mapper_class = PollMapper
