Created
February 11, 2012 00:03
-
-
Save ikks/1794257 to your computer and use it in GitHub Desktop.
Sample Search Form to avoid accents using translit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from haystack.forms import SearchForm | |
. | |
. | |
class RtSearchForm(SearchForm): | |
def search(self): | |
if hasattr(self,'cleaned_data') and self.cleaned_data['q']: | |
self.cleaned_data['q']=self.cleaned_data['q'].encode('translit/one/ascii', 'replace') | |
sqs = super(RtSearchForm, self).search() | |
return sqs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment