db.define_table('invoice_item',
SQLField('invoice_nr',required=True),
SQLField('ware',db.ware,required=True),
SQLField('discount','double',required=True),
SQLField('count','double',required=True))
db.invoice_item.ware.requires=IS_IN_DB(db,'ware.id','%(artnr)s%(size)s')
How to validate "count" field to be less or equal than db.ware.count in
corresponding record of table db.ware based on choice made by
invoice_item.ware?
To tell it simply, in human words: how to not sell more items than I
currently have?
I saw some validation examples in archives using IS_EXPR or custom
validators, but in those all relationships between fields stayed inside
the same table.
Julius
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---