I don't guess I follow. Isn't that the same as:
def userexist(namecheck):
if db(db.auth_user.username==namecheck).count() > 0:
return 'yes'
else:
return 'no'
So I"m saying your querry should be:
query = (db.auth_user.username==username)
Hope that helps
On Jun 29, 5:34 pm, elfuego1 <[email protected]> wrote:
> Hello,
>
> On this page:http://web2pyslices.com/main/slices/take_slice/53I have
> found a great pice of code which allows to check on the fly if there
> is an exact value already in database.
>
> Oryginal code:
>
> def ajaxuserexist():
> username = request.vars.values()[0]
> query = db.users.name.like(username)
> numres = db(query).count()
> if numres > 0 :
> return 'yes'
>
> return 'no'
>
> But when I try to implement the same solution on auth_user table for
> login column it stops working:
>
> query = db.auth_users.login.like(username)
>
> Do you know some solution/workaround to this problem?
>
> Best regards.