'Given a request, data and a desired format, produces a serialized
version suitable for transfer over the wire.
Mostly a hook, this uses the ``Serializer`` from ``Resource._meta``.'

def serialize(self, request, data, format, options=None):

    options = (options or {})
    if (u'text/javascript' in format):
        callback = request.GET.get(u'callback', u'callback')
        if (not is_valid_jsonp_callback_value(callback)):
            raise BadRequest(u'JSONP    callback    name    is    invalid.')
        options[u'callback'] = callback
    return self._meta.serializer.serialize(data, format, options)
