is this possible with computed

19 views
Skip to first unread message

Richard Vézina

unread,
Feb 4, 2011, 12:47:53 PM2/4/11
to web...@googlegroups.com
Hello Dear web2py users,

I would like to achieve this.

I have a referenced field 1 to many

The referenced table is mostly for storing the dropdown option.

So I have :

IS_IN_DB(choice1, choice2, etc.)

I would like to add on the same form a empty choice field that could populate the referenced choice table...

Field ('choice_id', db.choice),
db.choice # That let add new choice.

But

1) If the db.choice input is empty don't want add NULL value
2) I would if no choice is made and a new choice is added that choice_id takes the id of the new added choice...

Can I get something to work with "compute" that seems reserved for only one table.
How to prevent a empty db.choice input to be inserted... Is there any validator that could applied??

Thanks

Richard

Massimo Di Pierro

unread,
Feb 6, 2011, 1:01:48 AM2/6/11
to web2py-users
Long ago I made a widget for that. It got lost. If I cannot find it
will re-write it.

On Feb 4, 11:47 am, Richard Vézina <ml.richard.vez...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages