def coerceType(self, ftype, value):
        """Returns unicode(value) after trying to coerce it into the SOLR field type.

        @param ftype(string) The SOLR field type for the value
        @param value(any) The value that is to be represented as Unicode text.

        """
        if value is None:
            return None
        if ftype == 'string':
            return str(value)
        elif ftype == 'text':
            return str(value)
        elif ftype == 'int':
            try:
                v = int(value)
                return str(v)
            except Exception:
                return None
        elif ftype == 'float':
            try:
                v = float(value)
                return str(v)
            except Exception:
                return None
        elif ftype == 'date':
            try:
                v = datetime.datetime.strptime(value, '%b %d %Y %I:%M%p')
                return v.isoformat()
            except Exception:
                return None
        return str(value)
Returns unicode(value) after trying to coerce it into the SOLR field type.

        @param ftype(string) The SOLR field type for the value
        @param value(any) The value that is to be represented as Unicode text.