the reference to db.meeting should be db.community.

The user is not the same as user.id, but a string representing a user
(like an email, or a alias).

I think the example you suggested relies on the user being the same as
teh current user which is not the case.

Think of the participant table as containing "invitees" to a community
who may or may not have registered thusfar.  I want to avoid
duplicates and thus really need a multiple field (but single table)
uniqueness validator of some sort.

any ideas are much appreciated.

On Aug 18, 9:22 am, annet <[email protected]> wrote:
> Hi David,
>
> This should work:
>
> db.participants.community_id.requires=IS_NOT_IN_DB(db
> (db.participants.user==request.vars.user),db.table.community_id)
>
> Just out of curiosity: why user and not user_id and why db.meeting and
> not db.community?
>
> db.define_table('participants',
>     Field('user_id',db.user),
>     Field('community_id',db.community),
>     Field('stuff'))
>
> Kind regards,
>
> Annet.

Reply via email to