db.table.c.update = lambda row: row.a+row.b

is a function that compute the value of field c if you have field a
and field b.

On Nov 4, 12:04 pm, António Ramos <[email protected]> wrote:
> what is the field.update for?
>
> Thank you
>
> 2011/11/4 Richard Vézina <[email protected]>
>
>
>
>
>
>
>
> > db.table.field.writable and .readable = False
>
> > You will have to implement not null into the controller...
>
> > Just need to
>
> > if your condition:
> >   # SET your different fields to whatever you need
> >   db.table.field.writable and .readable = False
>
> > form = SQLFORM(db.table)
>
> > You will have to manage also the default and update properties for each
> > field the same way
>
> > if ...:
> >   db.table.field.default =
> >   db.table.field.update =
>
> > For a bizzard reason the .default and .update setup seems to stop working,
> > I sent a email about that earlier this week but don't get any reply...
> > Maybe the syntax has changed...
>
> > There is surely other solutions more DRY, but this should work for simple
> > task.
>
> > Hope it helps.
>
> > Richard
>
> > 2011/11/4 António Ramos <[email protected]>
>
> >> Hello,
> >> i need something to group fields based on a rule
>
> >> for example i have 30 database fields
>
> >> the first 10 should be editable in condition 1. the remaining 20 fields
> >> should be blocked
> >> the next 10 in the condition 2 also the remaining 20 should be blocked
>
> >> and the last 10 in condition 3
>
> >> What is the best way to group fields?
>
> >> for example in the name of the field
>
> >> *_1_*field1  ? being _1_ the condition 1
>
> >> *_2_*field12  being _2_ the condition 2
>
> >> any ideas?

Reply via email to