summaryrefslogtreecommitdiff
path: root/test/orm/cascade.py
Commit message (Collapse)AuthorAgeFilesLines
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-1292/+0
| | | | | See README.unittests for information on how to run the tests. [ticket:970]
* - The "objects" argument to session.flush() is deprecated.Mike Bayer2009-03-011-1/+2
| | | | | | | | State which represents the linkage between a parent and child object does not support "flushed" status on one side of the link and not the other, so supporting this operation leads to misleading results. [ticket:1315]
* need sizes for mysqlMike Bayer2009-02-071-1/+1
|
* - When flushing partial sets of objects using session.flush([somelist]),Mike Bayer2009-02-071-0/+111
| | | | | pending objects which remain pending after the operation won't inadvertently be added as persistent. [ticket:1306]
* - Further refined 0.5.1's warning about delete-orphan cascadeMike Bayer2009-01-201-40/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | placed on a many-to-many relation. First, the bad news: the warning will apply to both many-to-many as well as many-to-one relations. This is necessary since in both cases, SQLA does not scan the full set of potential parents when determining "orphan" status - for a persistent object it only detects an in-python de-association event to establish the object as an "orphan". Next, the good news: to support one-to-one via a foreign key or assocation table, or to support one-to-many via an association table, a new flag single_parent=True may be set which indicates objects linked to the relation are only meant to have a single parent. The relation will raise an error if multiple parent-association events occur within Python. - Fixed bug in delete-orphan cascade whereby two one-to-one relations from two different parent classes to the same target class would prematurely expunge the instance. This is an extension of the non-ticketed fix in r4247. - the order of "sethasparent" flagging in relation to AttributeExtensions has been refined such that false setparents are issued before the event, true setparents issued afterwards. event handlers "know" that a remove event originates from a non-orphan but need to know if its become an orphan, and that append events will become non-orphans but need to know if the event originates from a non-orphan.
* - The "clear()", "save()", "update()", "save_or_update()"Mike Bayer2009-01-171-15/+15
| | | | | | Session methods have been deprecated, replaced by "expunge_all()" and "add()". "expunge_all()" has also been added to ScopedSession.
* - Using delete-orphan on a many-to-many relation is deprecated.Mike Bayer2009-01-151-4/+53
| | | | | | | | | | | | This produces misleading or erroneous results since SQLA does not retrieve the full list of "parents" for m2m. To get delete-orphan behavior with an m2m table, use an explcit association class so that the individual association row is treated as a parent. [ticket:1281] - delete-orphan cascade always requires delete cascade. Specifying delete-orphan without delete now raises a deprecation warning. [ticket:1281]
* Modified fails_on testing decorator to take a reason for the failure.Michael Trier2008-12-121-2/+2
| | | | | This should assist with helping to document the reasons for testing failures. Currently unspecified failures are defaulted to 'FIXME: unknown'.
* - Added more granularity to internal attribute access, suchMike Bayer2008-10-221-1/+30
| | | | | | | | that cascade and flush operations will not initialize unloaded attributes and collections, leaving them intact for a lazy-load later on. Backref events still initialize attrbutes and collections for pending instances. [ticket:1202]
* - The "entity_name" feature of SQLAlchemy mappersMike Bayer2008-08-021-0/+27
| | | | | has been removed. For rationale, see http://groups.google.com/group/sqlalchemy/browse_thread/thread/9e23a0641a88b96d?hl=en
* - reverted r4955, that was wrong. The backref responsible for the operation ↵Mike Bayer2008-07-191-31/+17
| | | | | | | is the one where the "cascade" option should take effect. - can use None as a value for cascade. - documented cascade options in docstring, [ticket:1064]
* - save-update and delete-orphan cascade event handlerMike Bayer2008-07-181-0/+93
| | | | | | now considers the cascade rules of the event initiator only, not the local attribute. This way the cascade of the initiator controls the behavior regardless of backref events.
* Chipping away at remaining cruft.Jason Kirtland2008-05-101-34/+31
|
* Test suite modernization in progress. Big changes:Jason Kirtland2008-05-091-296/+357
| | | | | | | | | | | - @unsupported now only accepts a single target and demands a reason for not running the test. - @exclude also demands an exclusion reason - Greatly expanded @testing.requires.<feature>, eliminating many decorators in the suite and signficantly easing integration of multi-driver support. - New ORM test base class, and a featureful base for mapped tests - Usage of 'global' for shared setup going away, * imports as well
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-5/+6
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* - fixed/added coverage for various cascade scenariosMike Bayer2008-03-181-3/+260
| | | | | - added coverage for some extra cases in dynamic relations - removed some unused methods from unitofwork
* - fix expunging of orphans with more than one parentAnts Aasma2008-03-101-0/+55
| | | | - move flush error for orphans from Mapper to UnitOfWork
* - modernized cascade.py testsMike Bayer2008-02-171-317/+252
| | | | | | | | | - your cries have been heard: removing a pending item from an attribute or collection with delete-orphan expunges the item from the session; no FlushError is raised. Note that if you session.save()'ed the pending item explicitly, the attribute/collection removal still knocks it out.
* - updated the naming scheme of the base test classes in test/testlib/testing.py;Mike Bayer2008-02-111-5/+5
| | | | | tests extend from either TestBase or ORMTest, using additional mixins for special assertion methods as needed
* - testbase is gone, replaced by testenvJason Kirtland2008-01-121-6/+6
| | | | | | - Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase - testing.db has the configured db - Fixed up the perf/* scripts
* Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. ↵Jason Kirtland2008-01-101-6/+7
| | | | No surprises.
* - fixed an attribute history bug whereby assigning a new collectionMike Bayer2008-01-071-0/+9
| | | | | | | | | | | to a collection-based attribute which already had pending changes would generate incorrect history [ticket:922] - fixed delete-orphan cascade bug whereby setting the same object twice to a scalar attribute could log it as an orphan [ticket:925] - generative select.order_by(None) / group_by(None) was not managing to reset order by/group by criterion, fixed [ticket:924]
* Migrated maxdb behavioral assumptions from unsupported to fails_onJason Kirtland2007-11-051-42/+44
|
* - session checks more carefully when determining "object X already in ↵Mike Bayer2007-11-011-1/+1
| | | | | | | | | another session"; e.g. if you pickle a series of objects and unpickle (i.e. as in a Pylons HTTP session or similar), they can go into a new session without any conflict - added stricter checks around session.delete() similar to update() - shored up some old "validate" stuff in session/uow
* Fixed a truncation error when re-assigning a subset of a collectionJason Kirtland2007-10-311-3/+57
| | | | (obj.relation = obj.relation[1:]) [ticket:834]
* change the in_ API to accept a sequence or a selectable [ticket:750]Ants Aasma2007-10-161-8/+8
|
* `from foo import (name, name)` isn't valid syntax for 2.3. ah well.Jason Kirtland2007-08-211-0/+1
| | | | omitting modules from sqlalchemy.__all__...
* merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to ↵Mike Bayer2007-07-271-12/+14
| | | | maintenance branch in branches/rel_0_3.
* - Deprecated DynamicMetaData- use ThreadLocalMetaData or MetaData insteadJason Kirtland2007-07-061-3/+3
| | | | | - Deprecated BoundMetaData- use MetaData instead - Removed DMD and BMD from documentation
* added test for "assign a list of objects", ensure cascade/persistence functionsMike Bayer2007-05-171-0/+35
|
* clarifying some cascade-based unit tests, adding a little more coverage,Mike Bayer2007-05-041-32/+256
| | | | | | and trying to remove unneeded parts of dependency.py cascades. also de-emphasizing the whole session.flush([oneobject]) thing since i dont really agree it should be supported
* - fixed bug where cascade operations incorrectly included deleted collectionMike Bayer2007-01-301-13/+33
| | | | items in the cascade [ticket:445]
* - fixed bug where delete-orphan basically didn't work with many-to-many ↵Mike Bayer2007-01-191-2/+27
| | | | | | relationships [ticket:427], backref presence generally hid the symptom
* added testcase for upcoming ticketMike Bayer2007-01-191-0/+50
|
* - logging is now implemented via standard python "logging" module.Mike Bayer2006-09-241-1/+1
| | | | | | | | | | | | | "echo" keyword parameters are still functional but set/unset log levels for their respective classes/instances. all logging can be controlled directly through the Python API by setting INFO and DEBUG levels for loggers in the "sqlalchemy" namespace. class-level logging is under "sqlalchemy.<module>.<classname>", instance-level logging under "sqlalchemy.<module>.<classname>.<hexid>". Test suite includes "--log-info" and "--log-debug" arguments which work independently of --verbose/--quiet. Logging added to orm to allow tracking of mapper configurations, row iteration fixes [ticket:229] [ticket:79]
* reorganized unit tests into subdirectoriesMike Bayer2006-06-051-0/+173