Note, the pending patch makes the change only in the case of SQLite with
date and time fields, so it will need to be altered to make the change
universal.
Anthony
On Wednesday, July 9, 2014 8:12:01 AM UTC-4, Massimo Di Pierro wrote:
>
> Yes. It should be appended... I see there is a pending pat
Yes. It should be appended... I see there is a pending patch. Will apply
asap.
On Tuesday, 8 July 2014 15:30:45 UTC-5, Anthony wrote:
>
> In DAL.sqlhtml_validators, we have:
>
> if field.unique:
> requires.insert(0,validators.IS_NOT_IN_DB(db,field))
>
> I wonder why IS_NOT_IN_DB is pr
In DAL.sqlhtml_validators, we have:
if field.unique:
requires.insert(0,validators.IS_NOT_IN_DB(db,field))
I wonder why IS_NOT_IN_DB is prepended rather appended to the list of
validators. Given that some of the validators may actually alter the value
to be inserted (e.g., CRYPT, IS_
I found the issue. Since the format of the date field (same happens for the
time field) is a text in sqlite we must postpone to the validator
IS_NOT_IN_DB the validator IS_DATE.
By setting:
db.user_table.birthday.requires=[IS_DATE(), IS_NOT_IN_DB(db,
'user_table.birthday')]
everything works as e
What is odd to me is that,on postgres the validator works as expected while
on sqlite it doesnât and it is the backend itself that raises the exception.
On Jul 8, 2014 6:43 PM, "Anthony" wrote:
> Are you saying you want an error message to appear on the form? For that,
> you need an IS_NOT_IN_DB
Are you saying you want an error message to appear on the form? For that, you
need an IS_NOT_IN_DB validator, regardless of the database backend.
Anthony
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.goo
Hi all, I've tested the same example on both postgres and sqlite:
def run():
db.define_table('user_table',
Field('birthday', 'date', unique=True))
grid = SQLFORM.grid(db.user_table.id, user_signature=False)
return {'grid':grid}
The expected behavior is to get an error m
7 matches
Mail list logo