summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/events.py
Commit message (Collapse)AuthorAgeFilesLines
* Generate API and resolve cross referencesVraj Mohan2013-11-171-4/+4
|
* Fix indentation issues in docstringspr/43Vraj Mohan2013-11-121-3/+3
|
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-1/+0
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-32/+62
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* - update ORM event docs to include that you can listen on an unmapped base,Mike Bayer2013-07-311-29/+32
| | | | [ticket:2777]
* - Removal of event listeners is now implemented. The feature isMike Bayer2013-07-261-53/+52
| | | | | | | | | | | | | | | | provided via the :func:`.event.remove` function. [ticket:2268] - reorganization of event.py module into a package; with the addition of the docstring work as well as the new registry for removal, there's a lot more code now. the package separates concerns and provides a top-level doc for each subsection of functionality - the remove feature works by providing the EventKey object which associates the user-provided arguments to listen() with a global, weak-referencing registry. This registry stores a collection of _ListenerCollection and _DispatchDescriptor objects associated with each set of arguments, as well as the wrapped function which was applied to that collection. The EventKey can then be recreated for a removal, all the _ListenerCollection and _DispatchDescriptor objects are located, and the correct wrapped function is removed from each one.
* - The mechanism by which attribute events pass along anMike Bayer2013-07-261-6/+27
| | | | | | | | | | | | | | | | | | | :class:`.AttributeImpl` as an "initiator" token has been changed; the object is now an event-specific object called :class:`.attributes.Event`. Additionally, the attribute system no longer halts events based on a matching "initiator" token; this logic has been moved to be specific to ORM backref event handlers, which are the typical source of the re-propagation of an attribute event onto subsequent append/set/remove operations. End user code which emulates the behavior of backrefs must now ensure that recursive event propagation schemes are halted, if the scheme does not use the backref handlers. Using this new system, backref handlers can now peform a "two-hop" operation when an object is appended to a collection, associated with a new many-to-one, de-associated with the previous many-to-one, and then removed from a previous collection. Before this change, the last step of removal from the previous collection would not occur. [ticket:2789]
* Fixed bug in ORM-level event registration where the "raw" orMike Bayer2013-07-181-5/+8
| | | | | | "propagate" flags could potentially be mis-configured in some "unmapped base class" configurations. Also in 0.8.3. [ticket:2786]
* - create a new system where we can decorate an event methodMike Bayer2013-07-081-14/+50
| | | | | | | | | | | | | | | | with @_legacy_signature, will inspect incoming listener functions to see if they match an older signature, will wrap into a newer sig - add an event listen argument named=True, will send all args as kw args so that event listeners can be written with **kw, any combination of names - add a doc system to events that writes out the various calling styles for a given event, produces deprecation messages automatically. a little concerned that it's a bit verbose but will look at it up on RTD for awhile to get a feel. - change the calling signature for bulk update/delete events - we have the BulkUD object right there, and there's at least six or seven things people might want to see, so just send the whole BulkUD in [ticket:2775]
* - A clear error message is emitted if an event handlerMike Bayer2013-02-251-4/+104
| | | | | | | | | | attempts to emit SQL on a Session within the after_commit() handler, where there is not a viable transaction in progress. [ticket:2662] - rework how SessionTransaction maintains state, using symbols instead. - add lots of notes and cross-linking for session events. - add a link to :func:`.select()` within :meth:`.FromClause.select`.
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-71/+88
|
* update the introMike Bayer2012-10-311-2/+2
|
* - do a straight __subclasses__ traversal here, so that we aren'tMike Bayer2012-10-281-9/+15
| | | | | | iterating through all mappers in memory when a new event is tacked onto an unmapped superclass, also removes the strong ref that was breaking some GC teardown tests
* - cover additional cases for [ticket:2585], where events are applied to base ↵Mike Bayer2012-10-281-1/+12
| | | | | | class after subclasses are already mapped
* - lets default propagate to True here since it was essentially alwaysMike Bayer2012-10-121-1/+7
| | | | propagated previously
* - [feature] Improvements to event listening forMike Bayer2012-10-121-9/+122
| | | | | | | | | | | | | | | | | | | mapped classes allows that unmapped classes can be specified for instance- and mapper-events. The established events will be automatically set up on subclasses of that class when the propagate=True flag is passed, and the events will be set up for that class itself if and when it is ultimately mapped. [ticket:2585] - [bug] The instrumentation events class_instrument(), class_uninstrument(), and attribute_instrument() will now fire off only for descendant classes of the class assigned to listen(). Previously, an event listener would be assigned to listen for all classes in all cases regardless of the "target" argument passed. [ticket:2590]
* mapper configured docMike Bayer2012-09-211-2/+10
|
* - [feature] New session events after_transaction_createMike Bayer2012-09-201-0/+20
| | | | | | | | and after_transaction_end allows tracking of new SessionTransaction objects. If the object is inspected, can be used to determine when a session first becomes active and when it deactivates.
* - rework scoped_session and sessionmaker, [ticket:2500]Mike Bayer2012-09-101-7/+15
| | | | - rewrite tons of session docs
* - modernize most of the postgis example. would like to do [ticket:1534] also.Mike Bayer2012-08-161-2/+4
| | | | | - we don't have coverage for type-wide instrumentation events, the listener was broke. could break again too.
* - update engine docstrings due to moveMike Bayer2012-08-131-1/+1
| | | | - struggle with Operators class autodoc
* - express most of the orm.util functions in terms of the inspection systemMike Bayer2012-07-161-173/+173
| | | | | | | | | | | | | | - modify inspection system: 1. raise a new exception for any case where the inspection context can't be returned. this supersedes the "not mapped" errors. 2. don't configure mappers on a mapper inspection. this allows the inspectors to be used during mapper config time. instead, the mapper configures on "with_polymorphic_selectable" now, which is needed for all queries - add a bunch of new "is_XYZ" attributes to inspectors - finish making the name change of "compile" -> "configure", for some reason this was only done partially
* - move all of orm to use absolute importsMike Bayer2012-06-231-1/+1
| | | | | | | | - break out key mechanics of loading objects into new "orm.loading" module, removing implementation details from both mapper.py and query.py. is analogous to persistence.py - some other cleanup and old cruft removal
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-1/+1
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* - add before_attach event, [ticket:2464]Mike Bayer2012-06-071-1/+27
|
* - [bug] Fixed bug whereby event.listen(SomeClass)Mike Bayer2012-01-071-1/+1
| | | | | | | forced an entirely unnecessary compile of the mapper, making events very hard to set up at module import time (nobody noticed this ??) [ticket:2367]
* - fix the index, [ticket:2366]Mike Bayer2012-01-051-42/+138
| | | | - the most explicit warning ever about mapper events
* happy new yearMike Bayer2012-01-041-1/+1
|
* update query.update(), query.delete(), sessionevents.after_bulk_update(), ↵Mike Bayer2011-12-061-14/+16
| | | | sessionevents.after_bulk_delete() docstirngs, [ticket:2324]
* remove all inline imports statements from events.py, [ticket:2279]Mike Bayer2011-09-221-33/+23
|
* - New event hook, MapperEvents.after_configured().Mike Bayer2011-09-101-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | Called after a configure() step has completed and mappers were in fact affected. Theoretically this event is called once per application, unless new mappings are constructed after existing ones have been used already. - New declarative features: - __declare_last__() method, establishes an event listener for the class method that will be called when mappers are completed with the final "configure" step. - __abstract__ flag. The class will not be mapped at all when this flag is present on the class. - New helper classes ConcreteBase, AbstractConcreteBase. Allow concrete mappings using declarative which automatically set up the "polymorphic_union" when the "configure" mapper step is invoked. - The mapper itself has semi-private methods that allow the "with_polymorphic" selectable to be assigned to the mapper after it has already been configured. [ticket:2239]
* and lets use the right method name here...Mike Bayer2011-08-251-3/+3
|
* add more discouragment from using before_/after_ mapper events for anything ↵Mike Bayer2011-08-251-0/+24
| | | | ORM-heavy
* - Added after_soft_rollback() Session event. ThisMike Bayer2011-08-011-9/+84
| | | | | | | | | | | | event fires unconditionally whenever rollback() is called, regardless of if an actual DBAPI level rollback occurred. This event is specifically designed to allow operations with the Session to proceed after a rollback when the Session.is_active is True. [ticket:2241] - SessionTransaction is mentioned in public docs, many more docstrings for events etc. otherwise
* - some doc reorgMike Bayer2011-03-171-1/+1
| | | | | | | | | | - change engine.Connection to _connection_cls so sphinx doesn't get upset - globally add "." to all :class:`Foo` - start naming sections that are mostly docstrings "API Documentation - blah blah" - move some ad-hoc docstrings into "API" sections, there is some inconsistency here and it may be that we just have to leave it that way - add "internals" rsts to core, orm, I'm not super thrilled how these look but they are targeted by some of the public api docs, users typically become aware of these anyway
* corrected a bunch of spelling typosDiana Clarke2011-02-281-4/+4
|
* - Fixed bug whereby Session.merge() would call theMike Bayer2011-02-121-1/+3
| | | | | | | | | | load() event with one too few arguments. [ticket:2053] - Added logic which prevents the generation of events from a MapperExtension or SessionExtension from generating do-nothing events for all the methods not overridden. [ticket:2052]
* - typo fix [ticket:2017]Mike Bayer2011-02-101-1/+1
|
* doc updatesMike Bayer2011-01-031-2/+37
|
* - add support for pickling with mutable scalars, mutable compositesMike Bayer2011-01-021-0/+27
| | | | | | | - add pickle/unpickle events to ORM events. these are needed for the mutable extension. - finish mutable extension documentation, consolidate examples, add full descriptions
* - whitespace removal bonanzaMike Bayer2011-01-021-123/+123
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - add QueryContext to load(), refresh()Mike Bayer2010-12-311-8/+41
| | | | | | - add list of attribute names to refresh() - ensure refresh() only called when attributes actually refreshed - tests. [ticket:2011]
* - removes the "on_" prefix.Mike Bayer2010-12-301-51/+51
|
* - factor out the dependency on the "on_" nameMike Bayer2010-12-301-1/+1
|
* - they don't want "on_". First step, change the naming convention on EventsMike Bayer2010-12-301-21/+21
| | | | so that non-events are just _name.
* - on_expire event, since we are starting to build off of events aroundMike Bayer2010-12-251-0/+9
| | | | | | | | | | | | full lifecycle - composite will use events to do everything we want it to, i.e. storing the composite in __dict__, invalidating it on change of any of the columns. - will reinstate mutability of composites via callable attached to the composite - but userland code will still need to establish change event listening on the composite itself, perhaps via a "mutable" mixin like the scalars.py example, perhaps via addition of descriptors to the mutable object.
* - add a new "on mapper configured" event - handy !Mike Bayer2010-12-251-2/+27
|
* - restore declarative support for "composite"Mike Bayer2010-12-231-1/+9
| | | | - add an example of mutable scalars with events