(self)
return fields
Initialise the data model preparers once here. Extracts the preparers
        from the model and generate a list of callables to avoid doing that
        work on every object instance over.
Initialise the data model preparers once here. Extracts the preparers
        from the model and generate a list of callables to avoid doing that
        work on every object instance over.
Initialise the data model preparers once here . Extracts the preparers from the model and generate a list of callables to avoid doing that work on every object instance over .
def init_prepare(self):
        """
        Initialise the data model preparers once here. Extracts the preparers
        from the model and generate a list of callables to avoid doing that
        work on every object instance over.
        """
        index_fields = getattr(self, '_fields', {})
        fields = []
        for name, field in iteritems(index_fields):
            if not isinstance(field, DEDField):
                continue

            if not field._path:
                field._path = [name]

            prep_func = getattr(self, 'prepare_%s_with_related' % name, None)
            if prep_func:
                fn = partial(prep_func, related_to_ignore=self._related_instance_to_ignore)
            else:
                prep_func = getattr(self, 'prepare_%s' % name, None)
                if prep_func:
                    fn = prep_func
                else:
                    fn = partial(field.get_value_from_instance, field_value_to_ignore=self._related_instance_to_ignore)

            fields.append((name, field, fn))

        return fields
def init_prepare ( self ) : index_fields = getattr ( self , '_fields' , { } ) fields = [ ] for name , field in iteritems ( index_fields ) : if not isinstance ( field , DEDField ) : continue if not field . _path : field . _path = [ name ] prep_func = getattr ( self , 'prepare_%s_with_related' % name , None ) if prep_func : fn = partial ( prep_func , related_to_ignore = self . _related_instance_to_ignore ) else : prep_func = getattr ( self , 'prepare_%s' % name , None ) if prep_func : fn = prep_func else : fn = partial ( field . get_value_from_instance , field_value_to_ignore = self . _related_instance_to_ignore ) fields . append ( ( name , field , fn ) ) return fields