sort = dfilters.OrderingFilter(
fields=(
('sort_key_author', 'alpha'),
- ('popularity', 'popularity'),
+ ('popularity__count', 'popularity'),
)
)
tag = dfilters.ModelMultipleChoiceFilter(
class BookJsonView(APIView):
def get(self, request, slug):
book = get_object_or_404(Book, slug=slug)
- js = conv(etree.parse(book.xml_file.path))
+ js = conv(etree.parse(book.xml_file.path), slug)
return JsonResponse(js, json_dumps_params={'ensure_ascii': False})