you can have a list of validators, that is, something like

db.task.assigned_to.requires= IS_IN_DB(db, db.user.id, '%(name)s')

is valid; so is:

db.task.assigned_to.requires= [
     IS_IN_DB(db, db.user.id),
     IS_IN_DB(db, db.group.user_id)
]

The key her is the validation is against the submitted valus for
db.task.assigned_to;  if your group table doesn't have a user_id field to
check against, you can implement your own custom validator to implement
whatever logic you need to accomplish what you want.

Hope this helps.

- Yarko


On Wed, Sep 2, 2009 at 8:56 AM, tititi <briant...@gmail.com> wrote:

>
> Hi everyone,
>
> I'm trying to keep the duplicate insert logic at the model level and
> would like to find out if there is a way to do this. For example, I
> would like a USER_ID and GROUP_ID to be validated before an insert can
> be committed. Using IS_IN_DB with 2 fields work? If there isn't
> support for it, is there a chance to add this feature in? Thanks.
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@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