On Apr 25, 2008, at 4:21 PM, Eric Lemoine wrote: >>> > Module sqlalchemy.orm.mapper:1198 in _postfetch >>> elif not c.primary_key and c.key in params and >>> self._get_state_attr_by_column(state, c) != params[c.key]: > Module shapely.geometry.base:255 in __ne__ >>> return not self.equals(other) > Module shapely.predicates:30 in __call__ >>> raise RuntimeError() # breakpoint FIXME > > As you can see, the __ne__ method of my object does get called.
this occurs well after any attribute history detection has happened (which is where comparsions are supposed to happen, if needed). The mapper has inserted the row, then it goes through the list of parameters which were inserted into the row and compares them to what is present on the object, so that it can detect Column-level defaults and other "auto"-generated values which need to be placed on the instance. This methodology is out of date since nowadays we have an explicit listing of which columns were "auto" generated - so try out the attached patch which refines the methodology in that section and should solve the issue. The patch is also ticket #1015 which needs test coverage before it can be committed (but is high priority for 0.4.6). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---
dont_compare_in_postfetch.patch
Description: Binary data