From d6b4a6b04a29f6913f0881099b0ef47a931c64ca Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Sun, 2 Dec 2012 01:24:15 +0100 Subject: [PATCH] Fixed a bug with type and python 2.x compat. --- rest_framework/renderers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/renderers.py b/rest_framework/renderers.py index 8c8f7ead9..4abce9065 100644 --- a/rest_framework/renderers.py +++ b/rest_framework/renderers.py @@ -382,7 +382,7 @@ class BrowsableAPIRenderer(BaseRenderer): # Creating an on the fly form see: # http://stackoverflow.com/questions/3915024/dynamically-creating-classes-python - OnTheFlyForm = type("OnTheFlyForm", (forms.Form,), fields) + OnTheFlyForm = type(str("OnTheFlyForm"), (forms.Form,), fields) data = (obj is not None) and serializer.data or None form_instance = OnTheFlyForm(data) return form_instance