Commit Graph

20 Commits

Author SHA1 Message Date
Mike Bayer c6bceb7775 - converted all lazy=True|False|None to 'select'|'joined'|'noload'
- converted all eager to joined in examples
- fixed beaker/advanced.py to reference RelationshipCache
2010-03-24 19:19:03 -04:00
Mike Bayer 1675811029 - To accomodate the fact that there are now two kinds of eager
loading available, the new names for eagerload() and
eagerload_all() are joinedload() and joinedload_all().  The
old names will remain as synonyms for the foreseeable future.

- The "lazy" flag on the relationship() function now accepts
a string argument for all kinds of loading: "select", "joined",
"subquery", "noload" and "dynamic", where the default is now
"select".  The old values of True/
False/None still retain their usual meanings and will remain
as synonyms for the foreseeable future.

- Added documentation to tutorial,mapper doc, api docs
for subqueryload, subqueryload_all, and other options.
2010-03-24 19:11:01 -04:00
Mike Bayer 065fcbd9d2 - The official name for the relation() function is now
relationship(), to eliminate confusion over the relational
algebra term.  relation() however will remain available
in equal capacity for the foreseeable future.  [ticket:1740]
2010-03-17 17:48:29 -04:00
Mike Bayer 3290ac23df - query.get() now returns None if queried for an identifier
that is present in the identity map with a different class
than the one requested, i.e. when using polymorphic loading.
[ticket:1727]
2010-03-13 12:28:50 -05:00
Mike Bayer c1e0978556 - Primary key values can now be changed on a joined-table inheritance
object, and ON UPDATE CASCADE will be taken into account when
the flush happens.  Set the new "passive_updates" flag to False
on mapper() when using SQLite or MySQL/MyISAM. [ticket:1362]

- flush() now detects when a primary key column was updated by
an ON UPDATE CASCADE operation from another primary key, and
can then locate the row for a subsequent UPDATE on the new PK
value.  This occurs when a relation() is there to establish
the relationship as well as passive_updates=True.  [ticket:1671]
2010-02-02 22:56:19 +00:00
Philip Jenvey 77b6e981a4 disable SAWarning exceptions when supports_sane_rowcount isn't supported so
VersioningTest can complete
2010-01-23 21:35:40 +00:00
Mike Bayer 734dce8b60 - Fixed bug whereby composite columns wouldn't load properly
when configured on a joined-table subclass, introduced in
version 0.5.6 as a result of the fix for [ticket:1480].
[ticket:1616] thx to Scott Torborg.
2009-11-15 20:39:39 +00:00
Mike Bayer db2ff89644 revert r6466 2009-11-03 04:57:09 +00:00
Mike Bayer cc9c615c5a - Fixed the call to get_committed_value() on CompositeProperty.
[ticket:1504]
2009-11-03 04:54:56 +00:00
Philip Jenvey 5a9c1b8824 merge from branches/clauseelement-nonzero
adds a __nonzero__ to _BinaryExpression to avoid faulty comparisons during hash
collisions (which only occur on Jython)
fixes #1547
2009-09-24 02:11:56 +00:00
Mike Bayer 8b328f6942 merged r6357 of rel_0_5 branch 2009-09-16 20:38:29 +00:00
Mike Bayer 998183be6b - contains_eager() now works with the automatically
generated subquery that results when you say
"query(Parent).join(Parent.somejoinedsubclass)", i.e.
when Parent joins to a joined-table-inheritance subclass.
Previously contains_eager() would erroneously add the
subclass table to the query separately producing a
cartesian product.  An example is in the ticket
description.  [ticket:1543]
2009-09-16 19:48:22 +00:00
Mike Bayer 72b9be719f - Fixed an obscure issue whereby a joined-table subclass
with a self-referential eager load on the base class
would populate the related object's "subclass" table with
data from the "subclass" table of the parent.
[ticket:1485]
2009-08-28 20:29:08 +00:00
Mike Bayer a04da2a417 - added **kw to ClauseElement.compare(), so that we can smarten up the "use_get" operation
- many-to-one relation to a joined-table subclass now uses get()
  for a simple load (known as the "use_get" condition),
  i.e. Related->Sub(Base), without the need
  to redefine the primaryjoin condition in terms of the base
  table. [ticket:1186]
- specifying a foreign key with a declarative column,
  i.e. ForeignKey(MyRelatedClass.id) doesn't break the "use_get"
  condition from taking place [ticket:1492]
2009-08-08 22:21:02 +00:00
Mike Bayer 8fc5005dfe merge 0.6 series to trunk. 2009-08-06 21:11:27 +00:00
Mike Bayer c1a36dfe41 - Fixed bug whereby a load/refresh of joined table
inheritance attributes which were based on
column_property() or similar would fail to evaluate.
[ticket:1480]
2009-07-25 21:26:28 +00:00
Mike Bayer c30cd4a6ab - fixed the test for FalseDiscriminator to use Boolean for picky postgresql
- added Query.enable_assertions(False) as a mediocre solution for [ticket:1424].
updated the recipe at http://www.sqlalchemy.org/trac/wiki/UsageRecipes/PreFilteredQuery to
reflect.
- moved most default Query state to be class level variables to start.  the dicts could
go as well but being overly careful to not place mutables there for the moment.
- a visit by the "dunder-private method names aren't cool" police
- continued undisciplined pep-8ness
2009-07-25 20:27:33 +00:00
Mike Bayer 818c9a617e - Using False or 0 as a polymorphic discriminator now
works on the base class as well as a subclass.
[ticket:1440]
2009-07-25 19:42:15 +00:00
Mike Bayer f300bb43de - Fixed bug whereby inheritance discriminator part of a
composite primary key would fail on updates.
Continuation of [ticket:1300].
2009-07-21 20:25:36 +00:00
Mike Bayer 45cec095b4 - unit tests have been migrated from unittest to nose.
See README.unittests for information on how to run
the tests.  [ticket:970]
2009-06-10 21:18:24 +00:00