- changed title to current lazyloader isnt detecting null PKs
- marked as major
- changed milestone to 0.4.xx
current lazyloader isnt detecting null PKs
Issue #803
resolved
I noticed when I have a one to one relationship, and the foreign key is NULL, and I access the related object, SA runs the query for FK=NULL.
ie, port.jack_id is None, but if I access port.jack, it selects from jack where id = NULL
Attached is a short program that shows the query being ran, sorry I do not know how to turn that into a proper test.
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner - removed milestone
Removing milestone: 0.4.xx (automated comment)
- Log in to comment
the use_get clause in lazyload() needs to check for a null PK, slightly complex because the mapper defines what kind of PK is null. alternatively, maybe query.get() should be smart enough to check an incoming null ident. not sure why this issue doesn't exist in 0.3 (or does it ?) since the code for m2o lazy load is essentially the same.