You have some errors here:

On Fri, Jul 31, 2009 at 4:47 PM, ivanvpan <[email protected]> wrote:

>
> Hello forum!
> I am trying to replace the default auth table 'auth_user' with my own:
> auth.settings.table_user = db.define_table(
>    auth.settings.table_user_name,


this can also be:

auth.settings.table_user = db.define_table( "auth_user",

the rest of the mandatory fields you can see on slide 125 at www.web2py.com,
or
as shown on http://www.web2py.com/examples/default/tools

You can add your own fields, but you must have the minumum fields, as they
are written.


>
>    Field('username', length=32, requires = [IS_NOT_EMPTY(), IS_LENGTH
> (32), IS_ALPHANUMERIC()]),
>    Field('email', length=128,default='', requires = [IS_EMAIL(),
> IS_NOT_EMPTY()]),
>    Field('password', 'password', readable=False,
>             label='Password', requires=CRYPT(digest_alg='sha512')),
>    Field('registration_key', length=128,
>             writable=False, readable=False, default=''))
> auth.define_tables()
>
> The table gets created, but when I try to register a user it seems
> like web2py is trying to access columns from the default table (which
> aren't there):
>  File "/home/.../web2py/applications/feed/controllers/read.py", line
> 44, in index
>    return dict(next=next, prev=prev, entries=entries, feeds=feeds,
> login_form=auth())
>  File "/home/.../web2py/gluon/tools.py", line 466, in __call__
>    return self.register()
>  File "/home/.../web2py/gluon/tools.py", line 880, in register
>    % form.vars
> KeyError: 'first_name'


This is because you defined a field "username", but the auth system is
looking for a field "first_name" -

as I said, the basic fields must be entered as shown, at a minimum.

Hope this helps,

- Yarko


>
>
> Dropped tables, created fresh ones, restarted web2py. Framework is
> latest version.
> Thanks!
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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