I'm trying to use validate_and_update_or_insert() to update/insert users 
into my auth_user table. 

user = [
    Storage(username="u1", password='p1', field2='field2'),
   Storage(username="u1", password='p1', field2='field2')]

for user in users:
    res = 
db(db.auth_user.username==user).validate_and_update_or_insert(password=user.password,
 
field2=user.field2)

When a user is inserted all is well.
*But when a user is to be updated then Web2py throws an exception finding 
that "object has no attribute 'primary_key'"*
What have I misunderstood?

I can't find any documentation for validate_and_update_or_insert() but it 
operates very similarly to validate_and_update or validate_and_insert

My Auth is as follows:
https_secure = False if isGAELocal() else True
auth = Auth(db, secure=https_secure)

The execution, above, is local and therefore over http but will be over 
https when it goes into production. i.e. testing using dev_appserver and 
targetting App Engine Big Table.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to