Yes. Because your first statement only declares a default value for a field
type 'string', the default field type.

The second statement, redefines the field as a reference field which by
default deletes all references if the parent record is deleted.

Check out
ondelete='CASCADE' #this is the default action for any field unless it's
set to 'NO ACTION'

in the book.

On Thursday, December 15, 2011, thodoris wrote:

> Well i guess that doing
>
> db.define_table('cat',
> Field('name'),
> Field('owner',db.person,default=db.**person.id <http://db.person.id/>))
> db.cat.owner.requires = IS_IN_DB(db, db.person.id)
>
> does the job.
>

Reply via email to