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)) id_p_indicator', 'current_month' and 'current_year' are unique.
How can I do it ?
Thanks
JC form = FORM('Activation code:',
INPUT(_name='left', requires=[IS_NOT_EMPTY(), IS_HEXSTR()], _type="text", _maxlength="4", _class='activation', _id="left"),
# more fields here
)
Forget all what you've read there (joke)
If you want this rules works anywhere and independent of any insert/update EVEN BY PROGRAM - use db.table._before_insert/update and so on (see http://www.web2py.com/books/default/chapter/29/06/the-database-abstraction-layer)
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/atu_jVYj-5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.