Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #1698 (closed defect: worksforme)

Opened 11 years ago

Last modified 11 years ago

saprovider query attribute

Reported by: brickenstein Owned by: anonymous
Priority: low Milestone: 1.0.x bugfix
Component: Identity Version: 1.0.4b3
Severity: normal Keywords:


Using Turbogears 1.41 and SQLAlchemy 0.4.2p3 I get exceptions in the identity framework, like this one

visit = visit_class.query.filter_by(visit_key=self.visit_key).first()

AttributeError?: type object 'VisitIdentity?' has no attribute 'query'

I attach a patch, which seems to solve the problem for me. Best regards, Michael


identity.patch Download (1.9 KB) - added by brickenstein 11 years ago.
saprovider patch

Change History

Changed 11 years ago by brickenstein

saprovider patch

comment:1 Changed 11 years ago by Chris Arndt

  • Milestone changed from 1.0.4 to 1.1

comment:2 Changed 11 years ago by nickl

  • Status changed from new to closed
  • Priority changed from normal to low
  • Resolution set to worksforme
  • Milestone changed from 1.1 to 1.0.x bugfix

I saw this error after upgrading from TurboGears 1.0.4b2 to 1.0.4.x (stable). The supplied patch is definitely the wrong way to go.

The reporter's project model.py and controllers.py will need to be corrected. Most likely they are using the wrong imports and the old-style session.query(TableClass) calls.

Examples of the correct usage are shown in the quickstart.

tg-admin quickstart -i -s identity_tutorial

comment:3 Changed 11 years ago by brickenstein

Thanks for the reply. Now I found the mistake. Actually, I have used the "mapper" from sqlalchemy.orm instead of turbogears.database.

Note: See TracTickets for help on using tickets.