On Jan 12, 10:26 am, mdipierro <[email protected]> wrote:
> On Jan 12, 12:46 am, KMax <[email protected]> wrote:
>
> > few questions bellow:
> > On 10 янв, 21:38, mdipierro <[email protected]> wrote:> There are two 
> > new features in trunk. One will probably stay, the other
> > > I do not know:
>
> > > 1) Before you could do
>
> > >     db.define_table('person',Field('name'),format='%(name)s')
> > >     db.define_table('dog',Field('name'),Field('owner',db.dog))
>
> > db.dog.owner refs to ?! self
>
> no but to db.person[db.dog.owner]

I believe KMax is correctly pointing out that the statement should
read:
db.define_table('dog',Field('name'),Field('owner',db.person))
and not
db.define_table('dog',Field('name'),Field('owner',db.dog))

>
> > > now you can also have things like
>
> > >     format=lambda person: person.name.capitalize()
>
> > What is the person is? db.person[id] or id of a row?
>
> db.person[id]

The person argument in the lambda function is a gluon.sql.Row object

Denes.
-- 
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