Error with date format field

22 views
Skip to first unread message

Christian Varas

unread,
Jul 28, 2022, 8:27:45 AM7/28/22
to web2py-usuarios
Hi, I'm developing an app and in the model there is a field with "date" format.
I'm using a grid to call this the table but when i insert a record fails when try to retrieve



    traceback (most recent call last):
  File "/Users/chris/Documents/web2py/applications/logistik/controllers/appadmin.py", line 264, in select
    rows = db(query, ignore_common_filters=True).select(
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/objects.py", line 2722, in select
    return adapter.select(self.query, fields, attributes)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/sqlite.py", line 87, in select
    return super(SQLite, self).select(query, fields, attributes)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/base.py", line 908, in select
    return self._select_aux(sql, fields, attributes, colnames)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/base.py", line 865, in _select_aux
    rows = self._select_aux_execute(sql)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/base.py", line 859, in _select_aux_execute
    self.execute(sql)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/__init__.py", line 69, in wrap
    return f(*args, **kwargs)
  File "/Users/chris/Documents/web2py/gluon/packages/dal/pydal/adapters/base.py", line 468, in execute
    rv = self.cursor.execute(command, *args[1:], **kwargs)
  File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/sqlite3/dbapi2.py", line 64, in convert_date
    return datetime.date(*map(int, val.split(b"-")))
ValueError: invalid literal for int() with base 10: b'28/07/2022'
date widget use "/" as separator, but date validator search for "-" as separator
image.png
How can I solve this ?
Any help is appreciated!

Cheers.
Chris

esteban....@gmail.com

unread,
Jul 28, 2022, 10:28:35 AM7/28/22
to web2py-...@googlegroups.com
Hi Cristian,
maybe you can check the dateformat in web2py_ajax.html
I hope this solves your problem.
Best regards,
Esteban

--
Has recibido este mensaje porque estás suscrito al grupo "web2py-usuarios" de Grupos de Google.
Para cancelar la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a web2py-usuari...@googlegroups.com.
Para ver esta conversación en el sitio web, visita https://groups.google.com/d/msgid/web2py-usuarios/CA%2Bs%2BuJub7vc0H%2BezbP6LJ%2BDuRQNCTQiJ0zS%3Ddpy0%2BQ0EfoALNw%40mail.gmail.com.

Christian Varas

unread,
Jul 29, 2022, 12:35:01 PM7/29/22
to web2py-...@googlegroups.com
Thanks Esteban, is woking now. I've changed web2py_ajax.html and it works! 

Thanks!

Reply all
Reply to author
Forward
0 new messages