The web2py Auth requires the auth_user table to have an id column. I suggest you move the data from your table to a new table wich has the correct field name. It is the easiest solution.
On Sep 12, 8:30 am, white fox <[email protected]> wrote: > hi, I have a website which is written by PHP, so i decided to move to > python and use web2py for new version of my site. > anyway, in my Mysql Database i have lots of tables, one of them is > "Users" table. the table is like this > > db.define_table ("qbp_user", > Field ("userid", "integer"), > Field ("email_address", "string", length = 50, required=True), > Field ("username", "string", length = 25, required=True), > Field ("PASSWORD", type='password', readable=False, length = 255, > required=True), > Field ("user_level", "string", length = 11, default=2), > Field ("signup_date", "datetime", default=now), > Field ("last_login", "datetime"), > Field ("country", "string", length = 50), > Field ("ip", "string", length = 50), > Field ("homepage", "string", length = 50), > Field ("activated", "integer", default=0), > Field ("session", "string", length = 255), > Field ("avatar", "string", length = 100), > Field ("signature", "text"), > Field ("messenger2", "string", length = 55), > Field ("title", "string", length = 20, default='Registered'), > Field ("Tell", "string", length = 20), > Field ("Address", "string", length = 500), > Field ("score", "integer"), > Field ("FullName", "string", length = 70), > Field ("ZipCode", "string", length = 50), > Field ("mode_state", "integer"), > Field ("status", "integer"), > Field ("active_mail", "string", length = 50, default=-1), > Field ("tanksto", "integer"), > Field ("tanksfrom", "integer"), > Field ("type", "integer"), > Field ("blog_url", "string", length = 100), > Field ("settings", "integer", default=1), > Field ('registration_key', length=512, writable=False, > readable=False, default=''), > Field ('reset_password_key', length=512, writable=False, > readable=False, default=''), > migrate = False) > > As you can see i have `userid` instead of `id` and have `FullName` > instead of `fist_name` and `last_name`, and at last i have > `email_address` as `email`, > this is a very big website and have different parts, so i can't > change fields name, because i'm sure my code broken in other parts. > > i know i can change the auth_user table name(i read about this > inhttp://web2py.com/book/default/chapter/08#Customizing-Auth), but is it > possible to change auth_users'fields names too? is it possible that i > migrate web2py authentication with my database? or i should my own > athentication? > > p.s: sorry for my bad english :)

