Bugs item #1642143, was opened at 2007-01-23 01:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1642143&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: SQLObject from repository
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Leandro Lucarella (llucax)
Assigned to: Nobody/Anonymous (nobody)
Summary: [PATCH] TypeError:unhashable instance using sqlbuilder.Table
Initial Comment:
Hi! Maybe this is a pretty weird use case (please let me know if there is a better way to do this).
What I wanted was just to store an ordered list of many-to-many relationships. To achieve this, I used an special intermediate table with an extra field for ordering. Then I write some custom SQL queries to do the join using sqlbuilder.table (Table instance) and friends.
The problem is I'm getting a TypeError ("TypeError: unhashable instance") when doing that, because Table and Field don't have the __hash__ magic method (and for the records, none SQLExpression does either).
Well, long story short, this is fixed by just adding the __hash__ method to SQLExpression class. Here is the patch and a simple testcase.
Again, please tell me if there is a cleaner way to achieve this with SQLObject.
Thanks!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1642143&group_id=74338
|