tomchristie/django-rest-framework — pull request #1071 by craigds (2013-08-29 05:41:22+00:00)
Title: add transform_<fieldname> methods to serializers

We've had these in a `GoodSerializer` base-class for a while now; I figured they're so useful they should really exist upstream.

Basically, serializers have `validate_` and it's quite annoying not being able to do the reverse on a per-field basis. So we added `transform_`.

The name was just copied from an old project I used to work on that did a related thing. Could be called something else. Haystack uses `prepare_` for preparing modelfields for search-indexing. `serialize_` is another option.

Small feature, but we use this all the time; I'm not really sure how other people are getting by without it.