On Mar 16, 2014, at 9:21 AM, Dirk Makowski <dirk.makow...@gmail.com> wrote:

> Hello there,
> 
> my ORM classes use a mixin that defines a field 'editor_id' which references 
> a user record.
> 
> When I load a freshly created record, editor_id is None, which is correct. 
> Then I change some values, set editor_id, save it and load it again, 
> editor_id is correctly set.
> 
> Now the strangeness happens: again I change some values and set editor_id, 
> but use the same value for editor_id it already has, SA stores a NULL value.

are you sure it's actually saying "SET NULL" in the SQL?   if the value isn't 
present in the params, that just means it's leaving it unaffected.  this is 
normal behavior when the value hasn't changed.

I can't say much else because these are only excerpts of code without context.

if you wanted to show, "stores a NULL", send a full script that does that and 
asserts it's the case.


-- 
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 http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to