summaryrefslogtreecommitdiff
path: root/test/orm/expire.py
Commit message (Collapse)AuthorAgeFilesLines
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-912/+0
| | | | | See README.unittests for information on how to run the tests. [ticket:970]
* move test by itself so that no fixture data is insertedMike Bayer2009-02-121-42/+45
|
* - a session.expire() on a particular collection attributeMike Bayer2009-02-111-0/+39
| | | | | | | | will clear any pending backref additions as well, so that the next access correctly returns only what was present in the database. Presents some degree of a workaround for [ticket:1315], although we are considering removing the flush([objects]) feature altogether.
* - session.expire() and related methods will not expire() unloadedMike Bayer2009-01-241-2/+16
| | | | | deferred attributes. This prevents them from being needlessly loaded when the instance is refreshed.
* - The "clear()", "save()", "update()", "save_or_update()"Mike Bayer2009-01-171-5/+5
| | | | | | Session methods have been deprecated, replaced by "expunge_all()" and "add()". "expunge_all()" has also been added to ScopedSession.
* Modified fails_on testing decorator to take a reason for the failure.Michael Trier2008-12-121-1/+1
| | | | | This should assist with helping to document the reasons for testing failures. Currently unspecified failures are defaulted to 'FIXME: unknown'.
* Corrected some ordering issues with tests.Michael Trier2008-11-021-3/+3
|
* attributes.get_history now reports some zero-length slots as the empty tuple ↵Jason Kirtland2008-08-181-1/+1
| | | | rather than an empty list. nice speed boost and memory reduction.
* - session.refresh() raises an informative error message ifMike Bayer2008-07-051-1/+39
| | | | | | | | | | | | | | the list of attributes does not include any column-based attributes. - query() raises an informative error message if no columns or mappers are specified. - lazy loaders now trigger autoflush before proceeding. This allows expire() of a collection or scalar relation to function properly in the context of autoflush. - whitespace fix to new Table prefixes option
* - Query.UpdateDeleteTest.test_delete_fallback fails on mysql due to subquery ↵Mike Bayer2008-06-091-16/+27
| | | | | | | | | | | | | | | | | in DELETE; not sure how to do this exact operation in MySQL - added query_cls keyword argument to sessionmaker(); allows user-defined Query subclasses to be generated by query(). - added @attributes.on_reconstitute decorator, MapperExtension.on_reconstitute, both receieve 'on_load' attribute event allowing non-__init__ dependent instance initialization routines. - push memusage to the top to avoid pointless heisenbugs - renamed '_foostate'/'_fooclass_manager' to '_sa_instance_state'/'_sa_class_manager' - removed legacy instance ORM state accessors - query._get() will use _remove_newly_deleted instead of expunge() on ObjectDeleted, so that transaction rollback restores the previous state - removed MapperExtension.get(); replaced by a user-defined Query subclass - removed needless **kwargs from query.get() - removed Session.get(cls, id); this is redundant against Session.query(cls).get(id) - removed Query.load() and Session.load(); the use case for this method has never been clear, and the same functionality is available in more explicit ways
* Chipping away at remaining cruft.Jason Kirtland2008-05-101-4/+5
|
* Test suite modernization in progress. Big changes:Jason Kirtland2008-05-091-79/+109
| | | | | | | | | | | - @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-58/+62
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* - when attributes are expired on a pending instance, anMike Bayer2008-03-121-0/+8
| | | | | error will not be raised when the "refresh" action is triggered and returns no result
* corrected assert_raises to be consistent with existing assertRaises() ↵Mike Bayer2008-03-061-2/+3
| | | | unittest method
* - added assert_raises() to TestBase classMike Bayer2008-03-061-1/+15
| | | | | | - session.refresh() and session.expire() raise an error when called on instances which are not persistent within the session - session._validate_persistent() properly raises an error for false check
* - state.commit() and state.commit_all() now reconcile the current dict ↵Mike Bayer2008-03-011-0/+2
| | | | | | | | | | | | | | | | against expired_attributes and unset the expired flag for those attributes. This is partially so that attributes are not needlessly marked as expired after a two-phase inheritance load. - fixed bug which was introduced in 0.4.3, whereby loading an already-persistent instance mapped with joined table inheritance would trigger a useless "secondary" load from its joined table, when using the default "select" polymorphic_fetch. This was due to attributes being marked as expired during its first load and not getting unmarked from the previous "secondary" load. Attributes are now unexpired based on presence in __dict__ after any load or commit operation succeeds.
* - added expire_all() method to Session. Calls expire()Mike Bayer2008-02-111-19/+226
| | | | | | | | | | for all persistent instances. This is handy in conjunction with ..... - instances which have been partially or fully expired will have their expired attributes populated during a regular Query operation which affects those objects, preventing a needless second SQL statement for each instance.
* expire with synonyms [ticket:964]Mike Bayer2008-02-051-1/+25
|
* - "Passive defaults" and other "inline" defaults can nowMike Bayer2008-01-281-0/+16
| | | | | | | be loaded during a flush() call if needed; in particular, this allows constructing relations() where a foreign key column references a server-side-generated, non-primary-key column. [ticket:954]
* - testbase is gone, replaced by testenvJason Kirtland2008-01-121-81/+81
| | | | | | - 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
* - added extra fk override testMike Bayer2008-01-101-0/+12
| | | | | | - proper error message is raised when trying to access expired instance attributes with no session present
* - disabled the "populate expired/deferred attributes as we come across them" ↵Mike Bayer2007-12-211-13/+19
| | | | functionality in mapper._instance(), as its not completed, doesn't properly handle mutable scalar attributes, and has poor test coverage
* mass load wont overwrite modified expired attributesMike Bayer2007-12-211-0/+14
|
* - reworked all lazy/deferred/expired callables to beMike Bayer2007-12-211-7/+22
| | | | | | | | serializable class instances, added pickling tests - cleaned up "deferred" polymorphic system so that the mapper handles it entirely - columns which are missing from a Query's select statement now get automatically deferred during load.
* - merged instances_yields branch r3908:3934, minus the "yield" part which ↵Mike Bayer2007-12-141-4/+4
| | | | | | | | | | | | | remains slightly problematic - cleanup of mapper._instance, query.instances(). mapper identifies objects which are part of the current load using a app-unique id on the query context. - attributes refactor; attributes now mostly use copy-on-modify instead of copy-on-load behavior, simplified get_history(), added a new set of tests - fixes to OrderedSet such that difference(), intersection() and others can accept an iterator - OrderedIdentitySet passes in OrderedSet to the IdentitySet superclass for usage in difference/intersection/etc. operations so that these methods actually work with ordering behavior. - query.order_by() takes into account aliased joins, i.e. query.join('orders', aliased=True).order_by(Order.id) - cleanup etc.
* fixed both group-deferred attributes and expired attributes to notMike Bayer2007-11-181-0/+14
| | | | blow away changes made on attributes before the load takes place
* - session.refresh() and session.expire() now support an additional argumentMike Bayer2007-11-181-0/+439
"attribute_names", a list of individual attribute keynames to be refreshed or expired, allowing partial reloads of attributes on an already-loaded instance. - finally simplified the behavior of deferred attributes, deferred polymorphic load, session.refresh, session.expire, mapper._postfetch to all use a single codepath through query._get(), which now supports a list of individual attribute names to be refreshed. the *one* exception still remaining is mapper._get_poly_select_loader(), which may stay that way since its inline with an already processing load operation. otherwise, query._get() is the single place that all "load this instance's row" operation proceeds. - cleanup all over the place