[Answered ]-Django when I try to search a form its value gets u'

2πŸ‘

βœ…

u” just means that the string is shown in unicode. Default encoding in django is unicode. Don’t bother too much with u”, the actual result will always be the string between the single quotes.

For more info, look here. http://docs.djangoproject.com/en/dev/ref/unicode/

So the error that you are getting is possible if types in query do not match. So instead of

message = '%s' % q 

try

message = str(q) 

or

message = int(q)

as may be applicable.

πŸ‘€Neo

Leave a comment