Thank you Anthony.

All this works very nicely.
Maybe the default format for auth_user should also be documented.

Let's say I have the following table :
db.define_table('message',
    Field('to', 'list:reference auth_user'),
    Field('status', 'list:integer'))

I want "status" to be a list of 0 as long as "to", but
"db.message.status.default = [0]*len(db.message.to.default)" does not
work.

Do you have any suggestion ?

Thanks,
Archibald

On 25 oct, 17:04, Anthony <abasta...@gmail.com> wrote:
> On Tuesday, October 25, 2011 10:38:38 AM UTC-4, Archibald Linx wrote:
>
> > Thank you Anthony.
>
> > Do you mean "multiple=(0,9)" ? I cannot find this possibility in the
> > documentation.
>
> Oops, yes, that's what I meant. Apparently, this is undocumented.
>
>
>
> > How can I specify that the format of auth_user be auth_user.username ?
>
> Should be something like IS_IN_DB(db, 'auth_user.id', db.auth_user._format,
> multiple=(0,9))
>
> Note, db.auth_user._format is the default format for auth_user, which is
> '%(username)s', which is what you want.
>
> Anthony

Reply via email to