This is wrong.
db.postcoderegio.regio.requires=[IS_INT_IN_RANGE(00,99),IS_LENGTH
(2),IS_NOT_EMPTY()]
validators are filters so the order it important. You can reverse the
order but I suspect you want
db.postcoderegio.regio.requires=IS_MATCH('\d{4}')
On Apr 6, 10:01 am, annet <[email protected]> wrote:
> I have got the following model:
>
> db.define_table('postcoderegio',
> SQLField('regio', type='integer', length=2, default='',
> notnull=True),
> SQLField('min', type='integer', length=4, default='',
> notnull=True),
> SQLField('max', type='integer', length=4, default='',
> notnull=True),
> SQLField('provincie', db.provincie, default='', notnull=True,
> ondelete='RESTRICT'),
> migrate=False)
>
> db.postcoderegio.regio.requires=[IS_INT_IN_RANGE(00,99),IS_LENGTH(2),
> IS_NOT_EMPTY()]
> db.postcoderegio.regio.requires=[IS_INT_IN_RANGE(0000,9999), IS_LENGTH
> (4), IS_NOT_EMPTY()]
> db.postcoderegio.regio.requires=[IS_INT_IN_RANGE(0000,9999), IS_LENGTH
> (4), IS_NOT_EMPTY()]
> db.postcoderegio.provincie.requires=IS_IN_DB(db, db.provincie.id, '%
> (provincie)s')
>
> When I try to insert a record using the appadmin interface I get an
> error on the regio field. The error message reads: not unicode.
>
> How do I solve this problem? And what is it's cause?
>
> Kind regards,
>
> Annet.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---