'Takes data stored in the bundle for the field and returns it. Used for
taking simple data and building a instance object.'

def hydrate(self, bundle):

    if self.readonly:
        return None
    if (self.instance_name not in bundle.data):
        if (self.is_related and (not self.is_m2m)):
            if (bundle.related_obj and (bundle.related_name in (self.attribute, self.instance_name))):
                return bundle.related_obj
        if self.blank:
            return None
        if self.attribute:
            try:
                val = getattr(bundle.obj, self.attribute, None)
                if (val is not None):
                    return val
            except ObjectDoesNotExist:
                pass
        if self.instance_name:
            try:
                if hasattr(bundle.obj, self.instance_name):
                    return getattr(bundle.obj, self.instance_name)
            except ObjectDoesNotExist:
                pass
        if self.has_default():
            if callable(self._default):
                return self._default()
            return self._default
        if self.null:
            return None
        raise ApiFieldError((u"The    '%s'    field    has    no    data    and    doesn't    allow    a    default    or    null    value." % self.instance_name))
    return bundle.data[self.instance_name]
