I am having trouble getting list:reference to work. I have made a tester 
app where db.py is:

db.define_table('tag',
                Field('name'),
                format='%(name)s')

db.define_table('product',
                 Field('name'),
                 Field('tags', 'list:reference tag'))

#this isn't necessary for the error, but things were getting out of hand
if db(db.product.id>0).count() != 0:
    db(db.tag.id > 0).delete()
    db(db.product.id > 1).delete()
    
a = db.tag.insert(name='red')
b = db.tag.insert(name='green')
c = db.tag.insert(name='blue')
db.product.insert(name='Toy Car', tags=[a, b, c])
db.product.insert(name='Toy Boat', tags=[a])

That part all seems to work and I get a correct database when I look in the 
Admin interface. This is from the manual. 
Then in the Database Administration interface, I create a new Product "Toy 
Truck" and select say "Green". But when I click submit, I get "Value not in 
database". If I try to add a new color to tag, the tag does not appear in 
the selection field when I then make a new product. I have similar problems 
in my own views, but figure if I can't get this...

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/62c78f8d-66b8-489c-a25d-c0881f94a4fbo%40googlegroups.com.

Reply via email to