db.define_table('user_account',
....
)
db.define_table('distributors',
    Field('account_id', db.user_account),
    Field('uadpoints_balance_available', 'integer', default=0),
)
db.define_table('ads',
    Field('member_id', db.user_account),
    Field('points', 'integer', default=0),
)
db.ads.points.requires = IS_INT_IN_RANGE(0,
db(db.distributors.account_id==db.ads.member_id).select()[0].uadpoints_balance_available)

Basically I want to limit the value of points assigned to an ad to the
maximum uadpoints_balance_available for a member. The reason I am trying
this crazy requires is I would like to use the SQLFORM.grid. If this (or
something similar) is not possible I will have to roll my own.

-- 
-- 
Regards,
Bruce Wade
http://ca.linkedin.com/in/brucelwade
http://www.wadecybertech.com
http://www.warplydesigned.com
http://www.fitnessfriendsfinder.com

Reply via email to