On 6/19/05, Oleg Broytmann <phd@...> wrote:
> On Sun, Jun 19, 2005 at 04:21:12PM -0400, Kevin Dangoor wrote:
> > For me, right now, the creation of b is failing (AttributeError)
> > saying that the ThingTwo object doesn't have an 'id' attribute.
> That's a known problem with setters, not ForeignKey. When you are
> constructing a new object whose setter is referred from the constructor
> __init__() and it (constructor) refers to a subbject, that subobject
> must already be created, because to create a subobject you must know the
> id of the parent object.
In my example, though, the subobject (a ThingOne object) has already
been created. I can understand needing the ID of the "otherThing" (the
ForeignKey), because that's what will end up going in the table. But,
looking at that "otherThing" object can be done independently of the
ThingTwo object getting its ID. (The ID of the ThingOne object goes
into the thing_two table, not the other way around...)
This code was working just fine in 0.6.1, which is why I'm figuring
something must've changed...