Greetings:

I'm creating my first model. I set up the database and first table
like this:

db=SQLDB('sqlite://db.db')

db.define_table('contact',
      SQLField('cont_first_name', 'string', length=15),
      SQLField('cont_last_name', 'string', length=25),
      SQLField('cont_organization', 'string', length=80),
      SQLField('cont_phone', 'string', length=20),
      SQLField('cont_email', 'string', length=80))

I have entered a couple of records via the admin interface and it
works fine. At the same time, I defined the following table:

db.define_table('classroom',
      SQLField('room_name', 'string', length=50, required=True),
      SQLField('room_location', 'string', length=80, required=True),
      SQLField('room_capabilities', 'string', length=80),
      SQLField('room_equipment', 'string', length=80),
      SQLField('room_photo', 'upload'),
      SQLField('id_contact', db.contact))

When I try to insert a new record into this table, I get the following
ticket:

Traceback (most recent call last):
  File "gluon/restricted.py", line 98, in restricted
  File "C:/web2py_win/applications/nydl/controllers/appadmin.py", line
272, in <module>
  File "gluon/globals.py", line 75, in <lambda>
  File "C:/web2py_win/applications/nydl/controllers/appadmin.py", line
102, in insert
  File "gluon/sqlhtml.py", line 377, in __init__
  File "gluon/sqlhtml.py", line 135, in widget
  File "gluon/validators.py", line 251, in options
  File "gluon/validators.py", line 238, in build_set
  File "gluon/sql.py", line 1979, in select
ValueError: too many values to unpack

I thought 'upload' might be giving me the problem, so I changed it to
blob, but that didn't work. Tried adding ID to the contact reference
(db.contact.id), to no avail. I made sure the contact definition came
before the call to it in the classroom definition. I bought and read
the manual, checked and rechecked this, searched the group, but
haven't been to see what I'm doing wrong.  Any suggestions?

TIA

Keith

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to