Hi web2py users,
currently i am working with the newest version of dal with an existing (and
currently in use by other users) database structure (Postgres), so i can't
change any field-name or something like that. In this Database is the field
'values' defined. But if I try to connect via psycopg2 driver und dal.py i
get an error:
Traceback (most recent call last):
File "test.py", line 87, in <module>
db = DB('bi_2302').get_db()
File "test.py", line 59, in get_db
converted.append(Field(str(field)))
File "/home/mao/dal.py", line 5307, in __init__
raise SyntaxError, 'Field: invalid field name: %s' % fieldname
SyntaxError: Field: invalid field name: values
The simple reason (it took me a long time thinking about that) is that the
DAL class has an Inherited method from dict called values. So i cant call
the field:
db = DAL('postgres://testuser:testpassword@testhost/testdb')
db.define_table('testtab', Field('test'), Field('values'))
db(db.testtab.values).select()
Do you have any ideas for a workaround or is there a possibility avoid this
problem.
Greets Max