I'm on SA 0.4.0 I was under the impression that you had to declare the relationship from both sides, and that backref was only used to update related objects when one side of the relation was changed. Can you point me to some docs for this?
~jon On Nov 30, 3:26 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Nov 30, 2007, at 3:26 PM, Jonathon Anderson wrote: > > > > > I'm seeing (seemingly random) instances of sqlalchemy not returning an > > object for a relation. It seems to think that the "<relation>_id" > > column is None. > > > The code in question is available at > >http://trac.mcs.anl.gov/projects/clusterbank/browser/trunk/source/pac... > > > Thanks in advance. > > from a cursory view, theres not much I can see wrong with the code, > although I see that you are declaring redundant relationships such as: > > allocations = relation(Allocation, > secondary=requests_allocations_table, backref="requests"), > requests = relation(Request, secondary=requests_allocations_table, > backref="allocations"), > > so you are in fact creating two "requests" relations as well as two > "allocations" relations. im not sure what version you're using but if > you're on SA 0.4.1 it should be raising an error when you do that. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---
