I am trying to use this function, however something is wrong. I saved the name "John", but when I pass john on username_and is called check_user, the output is always return results, even if the name is not stored in the Google data store. Why?
def check_user(self, username_):
query = db.Query(Registrations)
results = query.filter('username =', username_)
if results:
return results
user_username = self.request.get('username')
check_username_valid = self.check_user(user_username)
if not check_username_valid:
error_username_exists="Username already exists"
In the case of GQL, how can I pass a variable username_to the query? as:
qr = db.GqlQuery("Select * from Registrations Where username = ?????")
source
share