very strange. ConnectionWrapper is not a web2py/dal object. which version of psycopg2 are you using?
On Monday, 11 January 2016 21:27:24 UTC-6, Júlia Rizza wrote: > > I have an web2py app connected with a PostgreSQL database and it's raising > the following error: > > <type 'exceptions.TypeError'> must be psycopg2._psycopg.connection, not > ConnectionWrapper > > > I couldn't figure it out. This is the traceback: > > > Traceback (most recent call last): > File "/var/www/web2py/gluon/restricted.py", line 227, in restricted > exec ccode in environment > File "/var/www/web2py/applications/web2courses/models/02_menu.py" > <https://juliarizza.com/admin/edit/web2courses/models/02_menu.py>, line 38, > in <module> > if auth.has_membership('Teacher') or auth.has_membership('Admin'): > File "/var/www/web2py/gluon/tools.py", line 4350, in has_membership > group_id = self.id_group(group_id) # interpret group_id as a role > File "/var/www/web2py/gluon/tools.py", line 4320, in id_group > rows = self.db(self.table_group().role == role).select() > File "/var/www/web2py/gluon/packages/dal/pydal/objects.py", line 2025, in > select > return adapter.select(self.query,fields,attributes) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line > 1280, in select > sql = self._select(query, fields, attributes) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line > 1167, in _select > sql_w = ' WHERE ' + self.expand(query) if query else '' > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 952, > in expand > rv = op(first, second, **optional_args) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line > 444, in EQ > eq = PostgreSQLAdapter.EQ(self, first, second) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 846, > in EQ > self.expand(second, first.type)) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line 962, > in expand > rv = self.represent(expression, field_type) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line > 416, in represent > return PostgreSQLAdapter.represent(self, obj, fieldtype) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line > 349, in represent > return BaseAdapter.represent(self, obj, fieldtype) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/base.py", line > 1489, in represent > return self.adapt(obj) > File "/var/www/web2py/gluon/packages/dal/pydal/adapters/postgres.py", line > 53, in adapt > adapted.prepare(self.connection) > TypeError: must be psycopg2._psycopg.connection, not ConnectionWrapper > > > Can somebody help me? > > -- 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. For more options, visit https://groups.google.com/d/optout.