views:

95

answers:

1

I am trying to get the list:reference field type to work for web2py, but for some reason I am getting an error. I am trying the example on http://web2py.com/book/default/chapter/06:

db.define_table('tag',Field('name'),format='%(name)s')
db.define_table('product',
    Field('name'),
    Field('tags','list:reference tag'))

When I try this, I get the following error:

Traceback (most recent call last):
File "gluon/restricted.py", line 178, in restricted
File "C:/web2py/applications/idd/models/db.py", line 93, in <module>
File "gluon/sql.py", line 1309, in define_table
File "gluon/sql.py", line 1664, in _create
SyntaxError: Field: unknown field type: list:reference tag for tags

This should be really simple, but is not working. Am I missing something that the book doesn't tell us about?

A: 

You have an old web2py version. This feature was released in 1.83.2 the same time as the 3rd ed of the book.

mdipierro
That was it, I must have downloaded my version a day or two before the 1.83.2 release. It didn't even occur to me that my version was already out of date. Thanks for the help!
blastthisinferno
I use the repository because there are often multiple commits a day: http://code.google.com/p/web2py/source/list
Plumo