REST Framework, choices fields

30 views
Skip to first unread message

Lachlan Musicman

unread,
Oct 25, 2014, 11:38:27 PM10/25/14
to django...@googlegroups.com
When using GET to retrieve data, how do I populate the JSON with
get_FOO_display rather than FOO?

cheers
L.

--
You have to be really clever to come up with a genuinely dangerous
thought. I am disheartened that people can be clever enough to do that
and not clever enough to do the obvious thing and KEEP THEIR IDIOT
MOUTHS SHUT about it, because it is much more important to sound
intelligent when talking to your friends.
This post was STUPID.
-----------------------------------------------------------------------------------------------------------
The Most Terrifying Thought Experiment of All Time
http://www.slate.com/articles/technology/bitwise/2014/07/roko_s_basilisk_the_most_terrifying_thought_experiment_of_all_time.html

Lachlan Musicman

unread,
Oct 25, 2014, 11:40:59 PM10/25/14
to django...@googlegroups.com
<redface> Done.

long_type = serializers.CharField(source='get_FOO_display')
Reply all
Reply to author
Forward
0 new messages