(self, value)
return value
Converts Python values to a string for Whoosh.

        Code courtesy of pysolr.
Converts Python values to a string for Whoosh.
Converts Python values to a string for Whoosh .
def _from_python(self, value):
        """
        Converts Python values to a string for Whoosh.

        Code courtesy of pysolr.
        """
        if hasattr(value, 'strftime'):
            if not hasattr(value, 'hour'):
                value = datetime(value.year, value.month, value.day, 0, 0, 0)
        elif isinstance(value, bool):
            if value:
                value = 'true'
            else:
                value = 'false'
        elif isinstance(value, (list, tuple)):
            value = u','.join([force_text(v) for v in value])
        elif isinstance(value, (six.integer_types, float)):
            # Leave it alone.
            pass
        else:
            value = force_text(value)
        return value
def _from_python ( self , value ) : if hasattr ( value , 'strftime' ) : if not hasattr ( value , 'hour' ) : value = datetime ( value . year , value . month , value . day , 0 , 0 , 0 ) elif isinstance ( value , bool ) : if value : value = 'true' else : value = 'false' elif isinstance ( value , ( list , tuple ) ) : value = u',' . join ( [ force_text ( v ) for v in value ] ) elif isinstance ( value , ( six . integer_types , float ) ) : # Leave it alone. pass else : value = force_text ( value ) return value