'Takes data from the provided object and prepares it for storage in the
index.'

def prepare(self, obj):

    if self.use_template:
        return self.prepare_template(obj)
    elif (self.model_attr is not None):
        attrs = self.split_model_attr_lookups()
        current_objects = [obj]
        values = self.resolve_attributes_lookup(current_objects, attrs)
        if (len(values) == 1):
            return values[0]
        elif (len(values) > 1):
            return values
    if self.has_default():
        return self.default
    else:
        return None
