db.example.relationship.requires = IS_NULL_OR(IS_IN_DB(db, 'auth_user.id',
'auth_user.first_name'))

-Thadeus




On Tue, Jan 26, 2010 at 9:12 PM, rppowell <rppow...@hotmail.com> wrote:

> Hello;
>
> This is probably a basic thing that I am unable to figure out.
>
> I have the following table:
>
> db.define_table('example',
>    Field('relationship', db.auth_user))
>
> When I use the addadmin interface to insert a record, I have the
> option in the dropdown to provide a blank selection.
>
> If I submit, it gives me an error: 'value not in database'.
>
> I want figure out how to make this relationship optional/valid.
>
> I like the power the DAL gives in making a auth_user dropdown list (if
> I have users), but I also want the ability to 'blank' or null out the
> user (or option).
>
> Can someone help me figure this out?
>
> -rppowell
>
> --
> You received this message because you are subscribed to the Google Groups
> "web2py-users" group.
> To post to this group, send email to web...@googlegroups.com.
> To unsubscribe from this group, send email to
> web2py+unsubscr...@googlegroups.com<web2py%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web...@googlegroups.com.
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to