'Prepares the serializer that will be used to serialize.
Determines the serializer that will be used and prepares an
instance of it for later call.  This allows the serializer to
be accessed by extensions for, e.g., template extension.'

def preserialize(self, content_type, default_serializers=None):

    (mtype, serializer) = self.get_serializer(content_type, default_serializers)
    self.media_type = mtype
    self.serializer = serializer()
