summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/mutable.py
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed regression in the :mod:`sqlalchemy.ext.mutable` extensionMike Bayer2015-05-211-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | as a result of the bugfix for :ticket:`3167`, where attribute and validation events are no longer called within the flush process. The mutable extension was relying upon this behavior in the case where a column level Python-side default were responsible for generating the new value on INSERT or UPDATE, or when a value were fetched from the RETURNING clause for "eager defaults" mode. The new value would not be subject to any event when populated and the mutable extension could not establish proper coercion or history listening. A new event :meth:`.InstanceEvents.refresh_flush` is added which the mutable extension now makes use of for this use case. fixes #3427 - Added new event :meth:`.InstanceEvents.refresh_flush`, invoked when an INSERT or UPDATE level default value fetched via RETURNING or Python-side default is invoked within the flush process. This is to provide a hook that is no longer present as a result of :ticket:`3167`, where attribute and validation events are no longer called within the flush process. - Added a new semi-public method to :class:`.MutableBase` :meth:`.MutableBase._get_listen_keys`. Overriding this method is needed in the case where a :class:`.MutableBase` subclass needs events to propagate for attribute keys other than the key to which the mutable type is associated with, when intercepting the :meth:`.InstanceEvents.refresh` or :meth:`.InstanceEvents.refresh_flush` events. The current example of this is composites using :class:`.MutableComposite`.
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* Merge branch 'mutable-dict-update' of ↵Mike Bayer2014-08-251-0/+4
|\ | | | | | | https://bitbucket.org/goodscloud/sqlalchemy into pr27
| * add update() support to MutableDictMatt Chisholm2014-08-091-0/+4
| |
* | fix MutableDict.coerceMatt Chisholm2014-08-091-3/+3
|/ | | | If a class inherited from MutableDict (say, for instance, to add an update() method), coerce() would give back an instance of MutableDict instead of an instance of the derived class.
* PEP8 style fixesBrian Jarrett2014-07-131-11/+10
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Return the assigned value in MultableDict.setdefaultThomas Herve2014-06-241-1/+2
|
* - Fixed bug in mutable extension where :class:`.MutableDict` did notMike Bayer2014-05-141-0/+5
| | | | | report change events for the ``setdefault()`` dictionary operation. fixes #3051
* - Fixed bug in mutable extension as well asMike Bayer2014-03-191-0/+3
| | | | | | :func:`.attributes.flag_modified` where the change event would not be propagated if the attribute had been reassigned to itself. fixes #2997
* Remove uneeded import from code examplepr/60Wichert Akkerman2014-01-201-1/+0
| | | | | This had me reread the code twice to see if I missed why the import was present.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - reduce verbiage in mutation.py regarding legacy style, place under ↵Mike Bayer2013-11-291-7/+3
| | | | versionadded
* Fix cross referencesVraj Mohan2013-11-171-4/+4
|
* Remove reference to defunct classVraj Mohan2013-11-171-1/+1
| | | | | | We should probably reword this entirely as, IMHO, this should be in the changelog and not in the doc proper (which should only describe the current state of affairs).
* - add event.contains() function to the event package, returns TrueMike Bayer2013-07-261-1/+1
| | | | | if the given target/event/fn is set up to listen. - repair mutable package which is doing some conditional event listening
* - add a test for pullreq 8Mike Bayer2013-06-231-3/+3
| | | | - simplify
* make tests passpr/8Devi2013-06-201-1/+1
|
* check if compostite_class is of class typeDevi2013-06-191-1/+2
| | | | before checking if it is a subclass of `MutableComposite`
* Fixed bug where :class:`.MutableDict` didn't report a change eventMike Bayer2013-06-031-0/+4
| | | | | when ``clear()`` was called. [ticket:2730]
* MutableDict.__delitem__ should require only 'key' argumentAudrius Kažukauskas2013-01-171-2/+2
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* The :class:`.MutableComposite` type did not allow for theMike Bayer2012-12-031-35/+56
| | | | | | | | | | | :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/extDiana Clarke2012-11-191-43/+58
|
* iterate through column_attrs hereMike Bayer2012-11-181-8/+6
|
* - add HSTOREMike Bayer2012-11-171-3/+0
| | | | - this was a mistake in mutable
* - hstore adjustmentsMike Bayer2012-11-171-20/+58
|
* - move ext to relative importsMike Bayer2012-07-171-37/+37
|
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-6/+7
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* typos in lib/sqlalchemy/extDiana Clarke2012-03-171-1/+1
|
* happy new yearMike Bayer2012-01-041-1/+1
|
* fix a whole bunch of note:: / warning:: that were inline,Mike Bayer2011-12-251-3/+9
| | | | no longer compatible with docutils 0.8
* - Fixed bug in the mutable extension wherebyMike Bayer2011-07-011-10/+10
| | | | | | | if None or a non-corresponding type were set, an error would be raised. None is now accepted which assigns None to all attributes, illegal values raise ValueError.
* - Fixed bug in the mutable extension wherebyMike Bayer2011-06-301-2/+0
| | | | | | if the same type were used twice in one mapping, the attributes beyond the first would not get instrumented.
* - Repaired new "mutable" extension to propagateMike Bayer2011-06-041-8/+13
| | | | | | events to subclasses correctly; don't create multiple event listeners for subclasses either. [ticket:2180]
* - Fixed bugs in sqlalchemy.ext.mutable extension whereMike Bayer2011-05-141-5/+5
| | | | | | `None` was not appropriately handled, replacement events were not appropriately handled. [ticket:2143]
* - Removed the usage of the "collections.MutableMapping"Mike Bayer2011-04-281-5/+5
| | | | | | abc from the ext.mutable docs as it was being used incorrectly and makes the example more difficult to understand in any case. [ticket:2152]
* - Fixed mutable extension docs to show theMike Bayer2011-04-021-11/+25
| | | | | correct type-association methods. [ticket:2118]
* corrected a bunch of spelling typosDiana Clarke2011-02-281-1/+1
|
* - add support for pickling with mutable scalars, mutable compositesMike Bayer2011-01-021-113/+366
| | | | | | | - 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-55/+55
|
* - 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-2/+2
| | | | | | - 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-17/+17
|
* - mutable examples now move into sqlalchemy.ext.mutableMike Bayer2010-12-291-0/+281
- streamline interfaces, get Mutable/MutableComposite to be as minimal in usage as possible - docs for mutable, warnings regrarding mapper events being global - move MutableType/mutable=True outwards, move orm tests to its own module, note in all documentation - still need more events/tests for correct pickling support of composites, mutables. in the case of composites its needed even without mutation. see [ticket:2009]