Hello,

I'm getting an error. I have a table and I'm trying to insert this date 
format:

db.define('mytable',
        Field('game_date', 'date'),
        migrate=True)

db.mytable.insert(game_date='2016-10-25')

When I create a single record with that game date I get an error from web2py

Query Not Supported: need more than 1 value to unpack

However, when I switch the field to "datetime" and create a new record it 
seems to work okay.

Could someone please help me understand why this happens?

Here is the full traceback from appadmin

    Traceback (most recent call last):
  File "/web2py/myapp/toplineups/controllers/appadmin.py", line 269, in select
    *fields, limitby=(start, stop))
  File "/usr/local/lib/python2.7/site-packages/pydal/objects.py", line 2210, in 
select
    return adapter.select(self.query, fields, attributes)
  File "/usr/local/lib/python2.7/site-packages/pydal/adapters/sqlite.py", line 
82, in select
    return super(SQLite, self).select(query, fields, attributes)
  File "/usr/local/lib/python2.7/site-packages/pydal/adapters/base.py", line 
753, in select
    return self._select_aux(sql, fields, attributes, colnames)
  File "/usr/local/lib/python2.7/site-packages/pydal/adapters/base.py", line 
711, in _select_aux
    rows = self._select_aux_execute(sql)
  File "/usr/local/lib/python2.7/site-packages/pydal/adapters/base.py", line 
706, in _select_aux_execute
    return self.cursor.fetchall()
  File 
"/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py",
 line 68, in convert_timestamp
    datepart, timepart = val.split(" ")
ValueError: need more than 1 value to unpack

-- 
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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to