I am trying to have my app create a default user that will be used to
track administrative tasks.

Right now I have the following in the model section but auto inserting
to the auth_user table does not seem to work. Does this have to be
done manually or can I automatically create a user, group and group
membership for a site administrative user?

Right now I get the error:

NameError: name 'db' is not defined

Thanks,

Chris

Here is my code, it seems to worksfine for any other table but auth
table(s)

initializer_first_name  = 'Database'
initializer_last_name   = 'Initializer'
initializer_email       = '[email protected]'
initializer_password    = 'random'

dbvalue='None'
rows=db(db.auth_user.first_name=='Database').select(db.application.ALL)
for row in rows:
        dbvalue = row.name

if dbvalue == 'None':
 
db.application.insert(first_name=initializer_first_name,last_name=initializer_last_name,email=initializer_email,initializer_password=initializer_password)

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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/web2py?hl=en.

Reply via email to