Ticket #11034: export_as_json.diff

File export_as_json.diff, 588 bytes (added by kaikuehne, 16 years ago)

serializers.serialize also takes a format as first parameter.

  • docs/ref/contrib/admin/actions.txt

     
    203203
    204204    def export_as_json(modeladmin, request, queryset):
    205205        response = HttpResponse(mimetype="text/javascript")
    206         serialize.serialize(queryset, stream=response)
     206        serializers.serialize("json", queryset, stream=response)
    207207        return response
    208208
    209209Generally, something like the above isn't considered a great idea. Most of the
Back to Top