Hi,

i have a fieldtype 'date' in a table that I cannot create from using request.now.date() in the db.table.update_or_insert statement (even if a change the fieldtype and date value to string)

Traceback (most recent call last):
  File "/home/danto/web2py/gluon/restricted.py", line 204, in restricted
    exec ccode in environment
  File "/home/danto/web2py/applications/votomercado/controllers/info.py", line 428, in <module>
  File "/home/danto/web2py/gluon/globals.py", line 162, in <lambda>
    self._caller = lambda f: f()
  File "/home/danto/web2py/applications/votomercado/controllers/info.py", line 176, in historico_brand
    fecha = date
  File "/home/danto/web2py/gluon/dal.py", line 5617, in update_or_insert
    record = self(**values)
  File "/home/danto/web2py/gluon/dal.py", line 5502, in __call__
    return self._db(query).select(limitby=(0,1),for_update=for_update).first()
  File "/home/danto/web2py/gluon/dal.py", line 6330, in select
    return self.db._adapter.select(self.query,fields,attributes)
  File "/home/danto/web2py/gluon/dal.py", line 1282, in select
    rows = response(sql)
  File "/home/danto/web2py/gluon/dal.py", line 1272, in response
    self.execute(sql)
  File "/home/danto/web2py/gluon/dal.py", line 1359, in execute
    return self.log_execute(*a, **b)
  File "/home/danto/web2py/gluon/dal.py", line 1353, in log_execute
    ret = self.cursor.execute(*a, **b)
  File "/usr/lib/python2.7/site-packages/pysqlite2/dbapi2.py", line 66, in convert_timestamp
    datepart, timepart = val.split(" ")
ValueError: need more than 1 value to unpack

what am I doing wrong?

kind regards

Reply via email to