# model
from datetime import datetime
NOW=datetime.now()

# this isn't verbatim, but has all the salient fields.
# Don't worry about matching parens, here.
# It works in real life and I can load the table with data.
db.define_table('table1',
  Field('table0',db.source,
    requires=IS_NULL_OR(IS_IN_DB(db,'table0.id'))),
  Field('filename','upload',length=50),
  Field('dts','datetime',default=NOW,
    requires=IS_NULL_OR(IS_DATETIME())),
  Field('elapsed','time',default=0,
    requires=IS_NULL_OR(IS_TIME())),
)

After successfully inserting multiple rows into the table with
differing data, I get the following error when I visit the table with
appadmin. Any ideas what and where the problem might be?

Traceback (most recent call last):
  File "C:\web2py\gluon\restricted.py", line 178, in restricted
    exec ccode in environment
  File "C:/web2py/applications/myapp/views/appadmin.html", line 181,
in <module>
  File "C:\web2py\gluon\sqlhtml.py", line 934, in __init__
    for (rc, record) in enumerate(sqlrows):
  File "C:\web2py\gluon\sql.py", line 2503, in __iter__    yield self
[i]
  File "C:\web2py\gluon\sql.py", line 2438, in __getitem__
    (h, mi, s) = time_items + [0]
ValueError: need more than 2 values to unpack
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to