I have a script with the following code to try and add an admin user
to my database:
from elixir import *
from testexec.model import User, Group
from turbogears import config
metadata.bind = 'sqlite:///devdata.sqlite'
metadata.bind.echo = True
config.update({'sqlalchemy.dburi': 'sqlite:///devdata.sqlite'})
user = User(user_name='root',
email_address='[EMAIL PROTECTED]',
display_name='Fear Me',
password='password',)
group = Group(group_name='admin', display_name='Administrators')
group.users.append(user)
session.flush()
session.close()
However, the data is not persisting. I have even tried creating a
transaction session (session.begin() and then session.commit() at the
end) but still the user and group do not persist.
What am I doing wrong?
Thanks,
Jason
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---