pls try (not tested) 

> *1.* Change a already existing password of a user if I kow the username 
> of the user (username or ID)
>

db(db.auth_user.id == 2).update(password = 
db.auth_user.password.validate("password")[0] ) 

*2.* Create a new user if it's possible (with a username and a password of 
> course) 
>

db.auth_user.insert(first_name = 'first', last_name = 'last', 
email = 'em...@email.com', username = 'first_last', 
password = db.auth_user.password.validate("password")[0] ) 

*3.* List all the users in the storage db by username
>
 
db(db.auth_user.id > 0).select()
or
db().select(db.auth_user.ALL) 

*4*. Delete user (with username) if it's possible (if it's exist)
>
 
db(db.auth_user. username == 'first_last').delete() 

ref:
http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer

best regards,
stifan

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2478b0d5-48c3-4c41-8d68-aae8a9bced76%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to