durusmail: qp: Adding new accounts to 'users'
Adding new accounts to 'users'
2006-09-19
2006-09-19
2006-09-20
2006-09-20
2006-09-21
2006-09-21
2006-09-23
2006-09-23
2006-09-24
2006-09-25
2006-09-25
2006-09-25
Re: Adding new accounts to 'users'
2006-09-25
Adding new accounts to 'users'
John Tidmarsh
2006-09-19
I am trying to learn QP by writing a  simple application. I am new to object
databases as well.

The application redirects users who don't have an account to a 'create
account' page.I am unable to store new user accounts in the users database.
I understand 'users', 'session, are built-in sort-of-tables. Here's the
relevant snippet:
----------------------------
publ = get_publisher()
print repr(users_db.items())
u1 = User(login_name)
u1.set_password(passwd)
users_db.add(u1)
print repr(users_db.items())
publ.commit()
---------------------------
The print statements do show a new user has been added. But the new user
doesn't get committed to the database.

Is this the right way to add new accounts to the 'users' db. Any help in
understanding how transparent persistence works in QP will be appreciated.

Thanks
John
reply