]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
merged the polymorphic relationship refactoring branch in. i want to go further...
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Jan 2007 23:33:53 +0000 (23:33 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 28 Jan 2007 23:33:53 +0000 (23:33 +0000)
commitbbc5e7c285a160f148eafa0ab442675fe88551ce
tree71f407e9de4c29ac427d01acc7730ac3dd714a80
parent7a1a746d7abaebb1e1712224a8ebbf037cc94435
merged the polymorphic relationship refactoring branch in.  i want to go further on that branch and introduce the foreign_keys argument, and further centralize the "intelligence" about the joins and selectables into PropertyLoader so that lazyloader/sync can be simplified, but the current branch goes pretty far.
  - relations keep track of "polymorphic_primaryjoin", "polymorphic_secondaryjoin" which it derives from the plain primaryjoin/secondaryjoin.
  - lazy/eagerloaders work from those polymorphic join objects.
  - the join exported by PropertyLoader to Query/SelectResults is the polymorphic join, so that join_to/etc work properly.
  - Query builds itself against the base Mapper again, not the "polymorphic" mapper.  uses the "polymorphic" version
 only as appropriate.  this helps join_by/join_to/etc to work with polymorphic mappers.
  - Query will also adapt incoming WHERE criterion to the polymorphic mapper, i.e. the "people" table becomes the "person_join" automatically.
  - quoting has been modified since labels made out of non-case-sensitive columns could themselves require quoting..so case_sensitive defaults to True if not otherwise specified (used to be based on the identifier itself).
  - the test harness gets an ORMTest base class and a bunch of the ORM unit tests are using it now, decreases a lot of redundancy.
15 files changed:
CHANGES
lib/sqlalchemy/ext/selectresults.py
lib/sqlalchemy/orm/mapper.py
lib/sqlalchemy/orm/properties.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql.py
lib/sqlalchemy/sql_util.py
test/orm/inheritance5.py
test/orm/poly_linked_list.py
test/orm/polymorph.py
test/orm/relationships.py
test/sql/quote.py
test/testbase.py