Kent wrote: >> >> looking through CHANGES I can see mentions of several issues regarding >> flushing, merging, and composite primary keys, though none seem quite to >> match this particular symptom. in any case 0.5.2 is an old release so I >> would ask that you confirm this behavior on 0.5.7. >> >> >> > Third question: I extrapolate that merge() expects *all* fields are >> > populated? In other words, if merge() encounters a field whose value >> > is None, will it update that field to null in the database (as opposed >> > to leaving the value untouched in the database)? Does None mean >> > "leave it alone" or "update to null"? >> > > Yes, fair enough. In the meantime, do you know the answer to my > "Third question"?
None is going to "update to null". But this is not the same as "empty", i.e. the key isn't present in obj.__dict__ - that will amount to a skip. When you first create the object, the __dict__ is blank as far as values - The "None" only appears there when you first access the scalar attribute. If I were writing SQLA today, perhaps I'd have been a little more draconian-yet-consistent and made non-present attributes raise AttributeError, but this is what we have. > -- > 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. > > >
-- 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.
