diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-09 17:26:16 +0000 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2007-12-09 17:26:16 +0000 |
| commit | 4f5aa12547264fb6a2e2f3af58d02ff09949d302 (patch) | |
| tree | e8c5d1945109c6eac7f5c98acdb60699c23c8cfa /lib/sqlalchemy/orm | |
| parent | 8b1beee112f264799c9f6b1d1211d01c2884a0ed (diff) | |
| download | sqlalchemy-4f5aa12547264fb6a2e2f3af58d02ff09949d302.tar.gz | |
- added a warning when a relation() is added to an inheriting mapper that is present on a super-mapper; multiple DependencyProcessors are not expected during the flush process
- found an uncovered line in uow, was "covered" by one particular breaking test
Diffstat (limited to 'lib/sqlalchemy/orm')
| -rw-r--r-- | lib/sqlalchemy/orm/properties.py | 4 | ||||
| -rw-r--r-- | lib/sqlalchemy/orm/unitofwork.py | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/sqlalchemy/orm/properties.py b/lib/sqlalchemy/orm/properties.py index 775bcd0a5..f0cae49d8 100644 --- a/lib/sqlalchemy/orm/properties.py +++ b/lib/sqlalchemy/orm/properties.py @@ -399,6 +399,10 @@ class PropertyLoader(StrategizedProperty): # ensure the "select_mapper", if different from the regular target mapper, is compiled. self.mapper.get_select_mapper()._check_compile() + for inheriting in self.parent.iterate_to_root(): + if inheriting is not self.parent and inheriting.get_property(self.key, raiseerr=False): + warnings.warn(RuntimeWarning("Warning: relation '%s' on mapper '%s' supercedes the same relation on inherited mapper '%s'; this can cause dependency issues during flush" % (self.key, self.parent, inheriting))) + if self.association is not None: if isinstance(self.association, type): self.association = mapper.class_mapper(self.association, entity_name=self.entity_name, compile=False)._check_compile() diff --git a/lib/sqlalchemy/orm/unitofwork.py b/lib/sqlalchemy/orm/unitofwork.py index a6bf8df90..26ac3703e 100644 --- a/lib/sqlalchemy/orm/unitofwork.py +++ b/lib/sqlalchemy/orm/unitofwork.py @@ -734,7 +734,8 @@ class UOWTask(object): else: get_dependency_task(whosdep[0], dep).append(whosdep[1], isdelete=isdelete) else: - get_dependency_task(state, dep).append(obj, isdelete=isdelete) + # TODO: no test coverage here + get_dependency_task(state, dep).append(state, isdelete=isdelete) head = topological.sort_as_tree(tuples, allobjects) |
