separate the behavior of these two operations.
- _Label class overrides compare_self to return its ultimate object.
meaning, if you say someexpr.label('foo') == 5, it produces
the correct "someexpr == 5".
+- orm
+ - "delete-orphan" no longer implies "delete". ongoing effort to
+ separate the behavior of these two operations.
- mysql
- support for column-level CHARACTER SET and COLLATE declarations,
as well as ASCII, UNICODE, NATIONAL and BINARY shorthand.
if delete:
# head object is being deleted, and we manage its list of child objects
# the child objects have to have their foreign key to the parent set to NULL
+
+ # TODO: this cascade should be "delete" cascade
if not self.cascade.delete_orphan or self.post_update:
for obj in deplist:
childlist = self.get_object_dependencies(obj, uowcommit, passive=self.passive_deletes)
# the child objects have to have their foreign key to the parent set to NULL
if self.post_update:
pass
+ # TODO: this block based on "delete_orphan" should technically be "delete", but also
+ # is entirely not necessary
elif self.cascade.delete_orphan:
for obj in deplist:
childlist = self.get_object_dependencies(obj, uowcommit, passive=self.passive_deletes)
def __init__(self, arg=""):
values = util.Set([c.strip() for c in arg.split(',')])
self.delete_orphan = "delete-orphan" in values
- self.delete = "delete" in values or self.delete_orphan or "all" in values
+ self.delete = "delete" in values or "all" in values
self.save_update = "save-update" in values or "all" in values
self.merge = "merge" in values or "all" in values
self.expunge = "expunge" in values or "all" in values
class B(object):pass
for cascade in (
"save-update, delete",
- "save-update, delete-orphan",
+ #"save-update, delete-orphan",
"save-update, delete, delete-orphan"):
mapper(B, tableB, properties={
class B(object):pass
for cascade in (
"save-update, delete",
- "save-update, delete-orphan",
+ #"save-update, delete-orphan",
"save-update, delete, delete-orphan"):
mapper(A, tableA, properties={
'bs':relation(B, cascade=cascade)