Добрый день. Я использую django rest framework и у меня возникла следующая ошибка:

base_name argument not specified, and could not automatically determine the name from the viewset, as it does not have a .model or .queryset attribute.

Это как-то связано с роутером (routers.SimpleRouter()). Ниже приведен код.


from django.conf.urls import patterns, include, url
from rest_framework import viewsets, routers
import views

router = routers.SimpleRouter()
router.register(r'book', views.BookViewSet.as_view())


from django.shortcuts import render_to_response
from mobileapp.models import Book
from rest_framework import generics
from mobileapp.serializers import BookSerializer

class BookViewSet(generics.ListAPIView):
    serializer_class = BookSerializer
    def get_queryset(self):
        queryset = Book.objects.filter(user=self.request.user)
        return queryset.order_by('-id')


from mobileapp.models import Book
from rest_framework import serializers

class BookSerializer(serializers.ModelSerializer):
    class Meta:
        model = Book
        fields = ('id', 'url', 'date', 'comment')