I really like the approach crayzeewulf used here:
http://stackoverflow.com/questions/9683604/composite-key-in-web2py/9685846#9685846


On Wednesday, August 12, 2015 at 11:17:45 PM UTC-4, JC wrote:
>
> Hello,
> I´ve the following model:
>
> db.define_table('bsc_input',
>                 Field('id_p_indicator', db.p_indicator, label=T(
> 'Indicator'), notnull=True),
>                 Field('current_month', 'integer', label=T('Month'), 
> notnull=True),
>                 Field('current_year', 'integer', label=T('Year'), notnull=
> True),
>                 Field('current_value', 'float', label=T('Value'), notnull=
> True))  
>
>   and I want to setup a validation  so that I´m sure the combination of  '
> id_p_indicator', 'current_month' and 'current_year' are unique.
>
> How can I do it ?
>
> Thanks
>
> JC
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to