Possible Duplicate:
How to make case insensitive filter queries with Google App Engine?
Currently on my web app,
If I type in http://www.website.com/Rohit , it takes me to my desired profile page.
But if I type in http://www.website.com/rohit , it does not take me there, and it gets sent to the 404 error.
Basically, my username is stored as: Rohit
And any given user’s profile page is supposed to be: http://www.website.com/username
But I want the website to not care about capitals.
UPDATE
I now know, thanks to Martijn that my regex expression is ok. This is the code, I use to check Google App Engine to see if a username already exists or not:
u = User.all().filter('username =', username).get()
^How do I make this capitals-friendly (capital letters don’t make a difference?)
use
filter('username =', username.lower())to convert to lowercase beforehand.and you need to convert your database, changing all user names to lowercase as well:
you may run this from interactive console, using
fetch(offset,count)to adjust the amount of users converted in one run.