Re: Using request.GET and having issues

2011-04-16 Thread Karen Tracey
2011/4/16 Karen McNeil > Yep, the encoding was the problem. I just added a line >searchterm = searchterm.encode('utf-8') > Does the nltk code not support unicode? A better solution would be to never do explicit encoding yourself, but rather just pass unicode from the DB and unicode from req

Re: Using request.GET and having issues

2011-04-16 Thread Karen McNeil
Yep, the encoding was the problem. I just added a line searchterm = searchterm.encode('utf-8') and now it works! Thank you! On Apr 16, 9:19 am, Karen Tracey wrote: > 2011/4/16 Karen McNeil > > > > > I have the following view set up: > > > def concord(request): > >    searchterm = reques

Re: Using request.GET and having issues

2011-04-16 Thread Karen McNeil
No, that's not the issue. In addition to displaying the count, the page also shows the resulting sentences, and the count here is correct because no results were returned. I think Karen, below, might be right that it has something to do with the encoding of the search string... I'll try working th

Re: Using request.GET and having issues

2011-04-16 Thread Walt
> searchterm = request.GET['q'] Shouldn't this be: request.GET.get('q','') Walt -~ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email

Re: Using request.GET and having issues

2011-04-16 Thread Karen Tracey
2011/4/16 Karen McNeil > I have the following view set up: > > def concord(request): >searchterm = request.GET['q'] >... more stuff ... >return render_to_response('concord.html', locals()) > > With URL "http://mysite.com/concord/?q=برشه";, and template code > Your search for {{ se

Re: Using request.GET and having issues

2011-04-16 Thread Shawn Milochik
This doesn't appear to be a Django question. Your 'results' variable is being populated by checking the length of an nltk.text.ConcordanceIndex() instance. I'm not familiar with the nltk module, but I'm assuming you are at least a little, since you're using it. It appears that its length isn't usef

Using request.GET and having issues

2011-04-15 Thread Karen McNeil
I have the following view set up: def concord(request): searchterm = request.GET['q'] ... more stuff ... return render_to_response('concord.html', locals()) With URL "http://mysite.com/concord/?q=برشه";, and template code Your search for {{ searchterm }} returned {{ results }} re