(Reference == Reference) should be compilable

Bug #315188 reported by Paul Hummer
2
Affects Status Importance Assigned to Milestone
Storm
New
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.

Revision history for this message
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.