class BookHandler(BaseHandler):
model = Book
fields = ('slug', 'title')
-
+
@staff_required
def read(self, request, slug=None):
if slug:
return get_object_or_404(Book, slug=slug)
else:
return Book.objects.all()
-
+
@staff_required
def create(self, request):
form = BookImportForm(request.POST, request.FILES)