1. Jesper Nøhr
  2. django-piston


Jesper Nøhr  committed e4fb353

adding format as a kwarg to DjangoEmitter.render to allow for easy subclassing

  • Participants
  • Parent commits 92f9c3e
  • Branches default

Comments (0)

Files changed (1)

File piston/emitters.py

View file
  • Ignore whitespace
     Emitter for the Django serialized format.
-    def render(self, request):
+    def render(self, request, format='xml'):
         if isinstance(self.data, HttpResponse):
             return self.data
         elif isinstance(self.data, (int, str)):
             response = self.data
-            response = serializers.serialize('xml', self.data, indent=True)
+            response = serializers.serialize(format, self.data, indent=True)
         return response