by not raising an error when redundant mappers were set up, fixed
- added allow_null_pks option to Mapper, allows rows where some
primary key columns are null (i.e. when mapping to outer joins etc)
+- modifcation to unitofwork to not maintain ordering within the
+"new" list or within the UOWTask "objects" list; instead, new objects
+are tagged with an ordering identifier as they are registered as new
+with the session, and the INSERT statements are then sorted within the
+mapper save_obj. the INSERT ordering has basically been pushed all
+the way to the end of the flush cycle. that way the various sorts and
+organizations occuring within UOWTask (particularly the circular task
+sort) dont have to worry about maintaining order (which they werent anyway)
- fixed reflection of foreign keys to autoload the referenced table
if it was not loaded already
- [ticket:256] - pass URL query string arguments to connect() function
else:
self.identity_map = weakref.WeakValueDictionary()
- self.new = util.OrderedSet()
+ self.new = util.Set() #OrderedSet()
self.dirty = util.Set()
self.deleted = util.Set()
if not hasattr(obj, '_instance_key'):
mapper = object_mapper(obj)
obj._instance_key = mapper.instance_key(obj)
+ try:
+ delattr(obj, '_sa_insert_order')
+ except AttributeError:
+ pass
self.identity_map[obj._instance_key] = obj
attribute_manager.commit(obj)
raise InvalidRequestError("Object '%s' already has an identity - it cant be registered as new" % repr(obj))
if obj not in self.new:
self.new.add(obj)
+ obj._sa_insert_order = len(self.new)
self.unregister_deleted(obj)
def register_dirty(self, obj):
mapper = object_mapper(obj)
self.mappers.add(mapper)
task = self.get_task_by_mapper(mapper)
-
if postupdate:
mod = task.append_postupdate(obj)
if mod: self._mark_modified()
# deleted by this UOWTask's Mapper.
# in the case of the row-based "circular sort", the UOWTaskElement may
# also reference further UOWTasks which are dependent on that UOWTaskElement.
- self.objects = util.OrderedDict()
+ self.objects = {} #util.OrderedDict()
# a list of UOWDependencyProcessors which are executed after saves and
# before deletes, to synchronize data to dependent objects