I've got an edge-case that I can't reliably reproduce yet, and it's driving 
me crazy. 

I have a table/view that is used for an analytics report.   It just 
references 2 objects from a given table, along with a count.

class Report(Base):
    __tablename__ = 'report'
    id = Column(Integer, primary_key=True)
    object_a__id = Column(Integer, ForeignKey("object_a.id"))
    object_a2__id = Column(Integer, ForeignKey("object_a.id"))
    counted = Column(Integer, default=0)
    object_a = relationship("ObjectA", primaryjoin=
"Report.object_a__id==ObjectA.id")
    object_a2 = relationship("ObjectA", primaryjoin=
"Report.object_a2__id==ObjectA.id")


In certain circumstances (which I can't figure out), `object_a` is `None`, 
even though it exists in the database (and sometimes in the identity map, 
in an earlier row; or appears as object_a2).



-- 
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