'Given an instance of a serializer, return a dictionary of metadata
about its fields.'

def get_serializer_info(self, serializer):

    if hasattr(serializer, u'child'):
        serializer = serializer.child
    return OrderedDict([(field_name, self.get_field_info(field)) for (field_name, field) in serializer.fields.items()])
