summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/event.py
Commit message (Collapse)AuthorAgeFilesLines
* - implement armin's awesome metaclass adaptor, can drop the refs to MetaBase.Mike Bayer2013-05-301-2/+1
|
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-1/+1
| | | | as possible
* most of ORM passing...Mike Bayer2013-05-041-0/+3
|
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-4/+3
|
* plugging awayMike Bayer2013-04-271-2/+3
|
* - the raw 2to3 runMike Bayer2013-04-271-6/+4
| | | | - went through examples/ and cleaned out excess list() calls
* - add workaround for sqlite memusage tests, so no longer need to count to ↵Mike Bayer2013-01-121-4/+13
| | | | | | | | | | | | | 220/skip tests - Fixed potential memory leak which could occur if an arbitrary number of :class:`.sessionmaker` objects were created. The anonymous subclass created by the sessionmaker, when dereferenced, would not be garbage collected due to remaining class-level references from the event package. This issue also applies to any custom system that made use of ad-hoc subclasses in conjunction with an event dispatcher. Also in 0.7.10. [ticket:2650]
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* The :class:`.MutableComposite` type did not allow for theMike Bayer2012-12-031-0/+3
| | | | | | | | | | | :meth:`.MutableBase.coerce` method to be used, even though the code seemed to indicate this intent, so this now works and a brief example is added. As a side-effect, the mechanics of this event handler have been changed so that new :class:`.MutableComposite` types no longer add per-type global event handlers. Also in 0.7.10 [ticket:2624]
* just a pep8 pass of lib/sqlalchemy/Diana Clarke2012-11-191-4/+17
|
* - [feature] Improvements to event listening forMike Bayer2012-10-121-4/+7
| | | | | | | | | | | | | | | | | | | 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]
* - repair bool() for instance level event listener where events are ↵Mike Bayer2012-09-201-1/+1
| | | | classlevel, continuing [ticket:2516]
* - [feature] The before_cursor_execute eventMike Bayer2012-08-231-46/+125
| | | | | | | | | fires off for so-called "_cursor_execute" events, which are usually special-case executions of primary-key bound sequences and default-generation SQL phrases that invoke separately when RETURNING is not used with INSERT. [ticket:2459]
* -whitespace bonanza, contdMike Bayer2012-07-281-18/+18
|
* absolute imports in core, sqlMike Bayer2012-06-231-1/+1
|
* - [feature] Dramatic improvement in memoryMike Bayer2012-06-201-11/+95
| | | | | | | | usage of the event system; instance-level collections are no longer created for a particular type of event until instance-level listeners are established for that event. [ticket:2516] Also in 0.7.9.
* - [bug] Fixed event registration bugMike Bayer2012-03-071-9/+26
| | | | | | | | which would primarily show up as events not being registered with sessionmaker() instances created after the event was associated with the Session class. [ticket:2424]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - Added @event.listens_for() decorator, givenMike Bayer2011-04-021-0/+35
| | | | | | target + event name, applies the decorated function as a listener. [ticket:2106] - remove usage of globals from test.base.test_events
* - establish an "insert" option for events to control ordering if needed (not ↵Mike Bayer2011-02-251-2/+21
| | | | | | needed yet tho) - render foreign key constraints in the order in which they were cerated
* - rename EngineEvents to ConnectionEventsMike Bayer2011-02-171-6/+3
| | | | | | | | - simplify connection event model to be inline inside Connection, don't use ad-hoc subclasses (technically would leak memory for the app that keeps creating engines and adding events) - not doing listen-per-connection yet. this is closer. overall things are much simpler now (until we put listen-per-connection in...)
* - SchemaItem, SchemaType now descend from common typeMike Bayer2011-01-301-3/+13
| | | | | | | | | | | | | | | | | | SchemaEventTarget, which supplies dispatch - the dispatch now provides before_parent_attach(), after_parent_attach(), events which generally bound the _set_parent() event. [ticket:2037] - the _on_table_attach mechanism now usually uses the event dispatch - fixed class-level event dispatch to propagate to all subclasses, not just immediate subclasses - fixed class-level event unpickling to handle more involved inheritance hierarchies, needed by the new schema event dispatch. - ForeignKeyConstraint doesn't re-call the column attach event on ForeignKey objects that are already associated with the correct Column - we still need that ImportError on mysqldb CLIENT FLAGS to support mock DBAPIs
* QueryableAttribute can stringify itself without triggering a mapper compile. ↵Mike Bayer2011-01-121-1/+1
| | | | | | prevents confusion when stringing the attr during an exception for something else like a bad event listen
* - whitespace removal bonanzaMike Bayer2011-01-021-53/+53
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - factor out the dependency on the "on_" nameMike Bayer2010-12-301-15/+18
|
* - they don't want "on_". First step, change the naming convention on EventsMike Bayer2010-12-301-11/+11
| | | | so that non-events are just _name.
* callcount destructo engageMike Bayer2010-12-091-1/+3
|
* - more inlining. nominal execution on sqlite down to 36 calls, from 51 in 0.6.Mike Bayer2010-12-051-3/+21
|
* new calling style: event.listen(target, identifier, fn)Mike Bayer2010-12-011-6/+6
|
* - SessionEvents is on board and the event model is done, can start building ↵Mike Bayer2010-11-141-1/+7
| | | | 0.7 tip soon
* - basic docsMike Bayer2010-11-091-6/+1
| | | | - poolevent accepts Engine as a target
* - propagate flag on event.listen() results in the listener being placedMike Bayer2010-11-071-14/+35
| | | | | | | | | | | in a separate collection. this collection also propagates during update() - ClassManager now handles bases, subclasses collections. - ClassManager looks at __bases__ instead of __mro__ for superclasses. It's assumed ClassManagers are in an unbroken chain upwards through __mro__. - trying to get a clear() that makes sense on cls.dispatch - implemented propagate for attribute events, plus permutation-based test - implemented propagate for mapper / instance events with rudimentary test - some pool events tests are failing for some reason
* - attempting system of propagation. getting stuck on attempting to use ↵Mike Bayer2010-11-061-4/+8
| | | | instance methods as listeners.
* a little cleanup, but we probably need a generalized "propagate" mechanismMike Bayer2010-11-061-5/+0
|
* - most tests passing on adapted MapperExtensionMike Bayer2010-11-061-6/+17
|
* - begin adding tests for event registration and dispatch standaloneMike Bayer2010-10-021-17/+24
| | | | | - fix pickling again - other test fixes
* - add instrumentation eventsMike Bayer2010-10-021-7/+26
| | | | | | | | | - simplify listen_for_events example with new system - add "propagate", "retval", "raw" flags to attribute events. this solves the "return value" issue as well as the "subclass" issue. - begin thinking about event removal. Each listen() method will have a corresponding remove(). Custom listen() methods will have to package all the info onto the event function that is needed to remove its state.
* - get active_history to work, move attribute events into module-level classesMike Bayer2010-09-031-2/+7
|
* - refinements to DDL events, including new execute_if(), got pickling to workMike Bayer2010-09-031-0/+5
|
* doh, forgot about ddl events. need some work with the pickling.Mike Bayer2010-08-311-3/+5
|
* - moved out to on_before_execute, on_after_execute. not much option here,Mike Bayer2010-08-291-17/+2
| | | | | need both forms, the wrapping thing is just silly - fixed the listen() to not re-wrap continuously.
* going back to the simple way, plus trying to make the engine thing simpler, ↵Mike Bayer2010-08-281-51/+10
| | | | | | | and....doesn't work. on_before_execute and on_after_execute really not appealing here. might have to just go back to what it was the other day.
* - its probably worthwhile to make the primary listen() interface humane, i.e.:Mike Bayer2010-08-271-2/+56
| | | | | | | | | | | | | | | | def listen(target, args) so here we provide a "wrapper" approach that allows this, and it is basically pass-by-value. a pass-by-value event *may* support rewriting some of the args in the dictionary. the current listen will become "listen_raw" since it saves about 100% overhead versus the coercion to dict, and will be used internally, and will remain pass-by-reference. proxyconnection probably will rely upon the newer style of pass-by-value for "rewrite the args" types of calls.
* - reorganize events into cls->dispatch, which is an instance of _Dispatch.Mike Bayer2010-08-101-56/+79
| | | | | | cut down on extraneous stuff, cleanup The Event class never gets instantiated and its methods stay the same so that sphinx can get to it.
* this reorganizes things so the EventDescriptor and all is on a "Dispatch" ↵Mike Bayer2010-08-091-23/+31
| | | | | | | | | object. this leaves the original Event class alone so sphinx documents it. this is all a mess right now but the pool/engine tests are working fully at the moment so wanted to mark a working version.
* working with how this will be documented and having some probs with sphinxMike Bayer2010-08-091-6/+4
|
* confirmed we can get this to trigger if we apply heisenbug compensationMike Bayer2010-08-081-4/+2
|
* fixes, but still unsure of thingsMike Bayer2010-08-081-0/+3
|
* getting attributes to workMike Bayer2010-08-081-5/+4
|