Andrew,

take a careful inspection of the docs/book about field references.
you setup user as a reference to a table, but when trying to set the
default you are setting it to a field.  it needs to know which user to
select.  also, in this case the default would need to be the ID of a
user not a first name.  you should look for docs about the "represent"
parameter that should help with the default rendering of the field (i
don't remember the details myself, just know that it's there).

also the auto-magical joins do happen when you have the table setup
properly.  you should be able to do:

 {{=row.user.last_name}}

or

{{=row.user.email}}

and web2py will join the auth table for you auto-magically.

good luck,

cfh
On Sep 13, 9:29 pm, Andrew Evans <[email protected]> wrote:
> Sorry that title is the error I would see when trying to access the default
> value of first_name
>
> On Mon, Sep 13, 2010 at 9:26 PM, ukolo <[email protected]> wrote:
> > Hello
>
> > I am trying to access this and other fields
>
> > db.define_table(
> >    auth.settings.table_user_name,
> >    Field('first_name', length=128, default=''),
>
> > from this table
>
> > db.define_table('product',
> >    Field('user', custom_auth_table,
> > default=custom_auth_table.first_name, readable=False, writable=False),
>
> > I am trying to figure out why I can't pull first_name or other values
> > from my data
>
> > {{for row in rows:}}
>
> >  {{=row.user}}
>
> > Ultimately I would like to be able to use other values also like
>
> >  {{=row.user.custom_auth_table.last_name}}
>
> > or
>
> > {{=row.user.custom_auth_table.email}}
>
> > How can I do this?
>
> > Any ideas *cheers
>
>

Reply via email to