On Fri, Apr 25, 2008 at 8:48 PM, Eric Lemoine <[EMAIL PROTECTED]> wrote: > On Fri, Apr 25, 2008 at 5:55 PM, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > > > > On Apr 25, 2008, at 11:37 AM, Eric Lemoine wrote: > > > > > > > > > > Hello > > > > > > I have the following code in my pylons app: > > > > > > refugee = Refugee(value, geometry) > > > model.Session.save(refugee) > > > model.Session.commit() > > > > > > Refugee is the class mapped to my Table object (refugees_table). > > > geometry is an instance of a custom type, for which I created a > > > Geometry(TypeEngine) class. > > > > > > In commit(), SQLAlchemy compares the geometry object to some other > > > geometry object (yes, my Geometry class defines the compare_values > > > method). I'd just like to know what object my geometry object is > > > compared to? I'm just saving a new object in the db table so why > > > there's a need to compare it to something else? > > > > > > > actually, it shouldnt be compared to anything. are you on 0.4 ? > > It does compare something, AFICT. I'm on 0.4.5.
Here is the stack trace: Module unhcr.controllers.refugees:80 in post >> model.Session.commit() Module sqlalchemy.orm.scoping:98 in do >> return getattr(self.registry(), name)(*args, **kwargs) Module sqlalchemy.orm.session:544 in commit >> self.transaction.commit() Module sqlalchemy.orm.session:250 in commit >> self._prepare_impl() Module sqlalchemy.orm.session:234 in _prepare_impl >> self.session.flush() Module sqlalchemy.orm.session:757 in flush >> self.uow.flush(self, objects) Module sqlalchemy.orm.unitofwork:233 in flush >> flush_context.execute() Module sqlalchemy.orm.unitofwork:445 in execute UOWExecutor().execute(self, tasks) Module sqlalchemy.orm.unitofwork:930 in execute self.execute_save_steps(trans, task) Module sqlalchemy.orm.unitofwork:945 in execute_save_steps >> self.save_objects(trans, task) Module sqlalchemy.orm.unitofwork:936 in save_objects >> task.mapper._save_obj(task.polymorphic_tosave_objects, trans) Module sqlalchemy.orm.mapper:1158 in _save_obj >> mapper._postfetch(uowtransaction, connection, table, state, c, >> c.last_inserted_params(), value_params) 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. -- Eric --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---