mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-29 13:04:03 +03:00
return choices as unicode and not string,
might as well have jsonp return unicode
This commit is contained in:
parent
027c9079f6
commit
d3aedd5fb1
|
@ -100,7 +100,7 @@ class JSONPRenderer(JSONRenderer):
|
||||||
callback = self.get_callback(renderer_context)
|
callback = self.get_callback(renderer_context)
|
||||||
json = super(JSONPRenderer, self).render(data, accepted_media_type,
|
json = super(JSONPRenderer, self).render(data, accepted_media_type,
|
||||||
renderer_context)
|
renderer_context)
|
||||||
return "%s(%s);" % (callback, json)
|
return u"%s(%s);" % (callback, json)
|
||||||
|
|
||||||
|
|
||||||
class XMLRenderer(BaseRenderer):
|
class XMLRenderer(BaseRenderer):
|
||||||
|
@ -306,7 +306,7 @@ class BrowsableAPIRenderer(BaseRenderer):
|
||||||
if getattr(widget, 'choices', None):
|
if getattr(widget, 'choices', None):
|
||||||
choices = widget.choices
|
choices = widget.choices
|
||||||
if any([ident != desc for (ident, desc) in choices]):
|
if any([ident != desc for (ident, desc) in choices]):
|
||||||
choices = [(ident, "%s (%s)" % (desc, ident))
|
choices = [(ident, u"%s (%s)" % (desc, ident))
|
||||||
for (ident, desc) in choices]
|
for (ident, desc) in choices]
|
||||||
widget.choices = choices
|
widget.choices = choices
|
||||||
kwargs['widget'] = widget
|
kwargs['widget'] = widget
|
||||||
|
|
Loading…
Reference in New Issue
Block a user