(Reference == Reference) should be compilable

Bug #315188 reported by Paul Hummer on 2009-01-08
2
Affects Status Importance Assigned to Milestone
Storm
Undecided
Unassigned

Bug Description

So this is rather odd, but after some discussions with various people, I think it best to file a bug.

I have an And() parameter similar to the one below:

            And(
                Raver.club == Club.id,
                Club.bouncer == BouncerCompany.team,
                BouncerCompany.employee == 4)
            )

The basic idea is that I can connect Ravers and the Bouncers they might come in contact with, where a Bouncer could work for many different BouncerCompany entries.

This code will raise

TypeError: Expected int, found <class 'storm.references.Reference'>

Working code is:

            And(
                Raver.club == Club.id,
                Club.bouncerID == BouncerCompany.teamID,
                BouncerCompany.employee == 4)
            )

I would think that regardless of whether it fetched the foreign object in each case, the comparison would work fine in the first instance, but it doesn't.

Please for to implement this feature.

James Henstridge (jamesh) wrote :

I'd guess that "Club.bouncer == BouncerCompany.teamID" works fine too. The problem is that the Reference.__eq__() method doesn't cover "Reference == Reference".

We should be able to support that case when the remote key of both relations is the same (in which case we can just compare the local keys of the two relations).

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers