I can't seem to declare a valid relationship in my application, but can do 
so as a self-contained example.

the (working) example on the relevant columns is this:

    class IpAddress(Base):
        __tablename__ = 'ip_address'
        id = Column(Integer, primary_key=True)
        ip_address__cidr = Column(sqlalchemy.dialects.postgresql.CIDR, 
nullable=False)
        ip_range_id__primary = Column(Integer, ForeignKey("ip_range.id"), 
nullable=True)

        #  _session = object_session(self)
        ip_range__primary = relationship(
            "IpRange",
            primaryjoin="IpAddress.ip_range_id__primary==IpRange.id",
            uselist=False,
        )

        ip_ranges_in = relationship(
            "IpRange",
            
primaryjoin="IpAddress.ip_address__cidr.op('<<')(IpRange.ip_range__cidr)",
            viewonly=True,
        )


    class IpRange(Base):
        __tablename__ = 'ip_range'
        id = Column(Integer, primary_key=True)
        ip_range__cidr = Column(sqlalchemy.dialects.postgresql.CIDR, 
nullable=False)

        ip_addresses__primary = relationship(
            "IpAddress",
            primaryjoin="IpRange.id==IpAddress.ip_range_id__primary",
        )


I can't create a valid `IpAddress.tracked_ip_ranges` relationship in my 
application.  It complains that it wants a foreign(), then a remote(), then 
just fails.

Does anyone have tips on troubleshooting what is going on?  something is 
causing this to fail, but I can't figure out what.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to