summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/collections.py
Commit message (Collapse)AuthorAgeFilesLines
* - happy new yearMike Bayer2016-01-291-1/+1
|
* - refactor of adapt_like_to_iterable(), fixes #3457.Mike Bayer2015-12-091-53/+19
| | | | | | Includes removal of adapt_like_to_iterable() as well as _set_iterable(), uses __slots__ for collectionadapter, does much less duck typing of collections.
* Update usages of getargspec to compat version.pr/210Jacob MacDonald2015-10-291-1/+2
| | | | | The places inspect.getargspec was being used were causing problems for newer Python versions.
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* minor docstring fix in MappedCollection classJochem Oosterveen2015-03-061-2/+2
|
* - cyclomatic complexity: instrument_class goes from E to an AMike Bayer2014-09-271-11/+37
|
* - Fixed bug in ordering list where the order of items would beMike Bayer2014-09-101-0/+10
| | | | | | | | thrown off during a collection replace event, if the reorder_on_append flag were set to True. The fix ensures that the ordering list only impacts the list that is explicitly associated with the object. fixes #3191
* - Added new event handlers :meth:`.AttributeEvents.init_collection`Mike Bayer2014-09-071-17/+6
| | | | | | | and :meth:`.AttributeEvents.dispose_collection`, which track when a collection is first associated with an instance and when it is replaced. These handlers supersede the :meth:`.collection.linker` annotation. The old hook remains supported through an event adapter.
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-35/+38
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* Documentation fix-up: "its" vs. "it's"pr/91Matthias Urlichs2014-05-111-1/+1
| | | | | | | | | Removed ungrammatical apostrophes from documentation, replacing "it's" with "its" where appropriate (but in a few cases with "it is" when that read better). While doing that, I also fixed a couple of minor typos etc. as I noticed them.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - changelogMike Bayer2013-11-301-7/+8
| | | | - put list.clear() instrumentation under "if not py2k"
* orm.collection, list.clear(). remove 'before_delete()', added unit-test.pr/40schettino722013-11-251-1/+0
|
* Add support for python3.3 list.clear() on orm.collectionsschettino722013-11-061-0/+9
|
* Fixed bug where list instrumentation would fail to represent aMike Bayer2013-08-201-1/+4
| | | | | | | | setslice of ``[0:0]`` correctly, which in particular could occur when using ``insert(0, item)`` with the association proxy. Due to some quirk in Python collections, the issue was much more likely with Python 3 rather than 2. Also in 0.8.3, 0.7.11. [ticket:2807]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-6/+5
| | | | | | | | | - 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
* - after discussions with the original project folks working with zope securityMike Bayer2013-08-021-68/+55
| | | | | | | | | | | proxies, they aren't overriding getattr() or setattr() at all. so all the hardcoded getattr()/setattr() is removed from collections.py. Lots of these getattr/setattr were against the attributeimpl and decorated functions and don't seem like they'd ever be needed; for a user that needs special access to a collection, we can evaulate that use case and add a single point of "unwrapping", and probably add a hook for it via InstrumentationManager so that the collection implementation isn't complicated by it.
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-6/+6
| | | | as possible
* most of ORM passing...Mike Bayer2013-05-041-32/+25
|
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-5/+1
|
* - the raw 2to3 runMike Bayer2013-04-271-38/+41
| | | | - went through examples/ and cleaned out excess list() calls
* Fixed the (most likely never used) "@collection.link" collectionMike Bayer2013-01-211-10/+13
|\ | | | | | | | | | | | | | | | | method, which fires off each time the collection is associated or de-associated with a mapped object - the decorator was not tested or functional. The decorator method is now named :meth:`.collection.linker` though the name "link" remains for backwards compatibility. Courtesy Luca Wehrstedt. [ticket:2653]
| * Fix the collection.link decoratorLuca Wehrstedt2013-01-161-9/+9
| |
* | - Made some fixes to the system of producing custom instrumentedMike Bayer2013-01-211-131/+88
|/ | | | | | | | | | | | | | | | | collections, mainly that the usage of the @collection decorators will now honor the __mro__ of the given class, applying the logic of the sub-most classes' version of a particular collection method. Previously, it wasn't predictable when subclassing an existing instrumented class such as :class:`.MappedCollection` whether or not custom methods would resolve correctly. [ticket:2654] - The undocumented (and hopefully unused) system of producing custom collections using an ``__instrumentation__`` datastructure associated with the collection has been removed, as this was a complex and untested feature which was also essentially redundant versus the decorator approach. Other internal simplifcations to the orm.collections module have been made as well.
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* - significantly rework the approach to collection events and history within ↵Mike Bayer2012-12-211-2/+3
| | | | | | | | | | DynamicAttributeImpl - Fixes to the "dynamic" loader on :func:`.relationship`, includes that backrefs will work properly even when autoflush is disabled, history events are more accurate in scenarios where multiple add/remove of the same object occurs, as can often be the case in conjunction with the association proxy. [ticket:2637]
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-1/+20
|
* - [feature] Adding/removing None from a mapped collectionMike Bayer2012-08-131-4/+4
| | | | | | | | | | | now generates attribute events. Previously, a None append would be ignored in some cases. Related to [ticket:2229]. - [feature] The presence of None in a mapped collection now raises an error during flush. Previously, None values in collections would be silently ignored. [ticket:2229]
* - [feature] A warning is emitted when a referenceMike Bayer2012-08-041-0/+11
| | | | | | | | | to an instrumented collection is no longer associated with the parent class due to expiration/attribute refresh/collection replacement, but an append or remove operation is received on the now-detached collection. [ticket:2476]
* 2.3 is a distant memoryMike Bayer2012-07-031-71/+63
|
* - move all of orm to use absolute importsMike Bayer2012-06-231-10/+9
| | | | | | | | - 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
* - [bug] Fixed bug in 0.7.6 introduced byMike Bayer2012-04-191-8/+85
| | | | | | | | | | | | | | | | | [ticket:2409] whereby column_mapped_collection used against columns that were mapped as joins or other indirect selectables would fail to function. Here, the serialize use case has gotten very complex since to really target a column we'd need the root MetaData object, then if we're hitting Alias objects and such there's really nothing to hold onto. Short of building a system where Column objects have some kind of master hash identifier that is consistently generated, the way this works can't really suit every case - much easier would be to change the mechanics of collections.py to make available the Mapper to the collection adapter when it's first invoked.
* - [bug] Fixed bug whereby objects usingMike Bayer2012-03-051-15/+38
| | | | | | attribute_mapped_collection or column_mapped_collection could not be pickled. [ticket:2409]
* - [bug] Fixed bug whereby MappedCollectionMike Bayer2012-02-131-0/+11
| | | | | | | | | would not get the appropriate collection instrumentation if it were only used in a custom subclass that used @collection.internally_instrumented. [ticket:2406] - added docs for collection
* happy new yearMike Bayer2012-01-041-1/+1
|
* - [bug] Fixed inappropriate usage of util.py3kMike Bayer2011-12-151-1/+1
| | | | | | | flag and renamed it to util.py3k_warning, since this flag is intended to detect the -3 flag series of import restrictions only. [ticket:2348]
* marathon doc updating session including a rewrite of unicode paragraphsMike Bayer2011-12-041-14/+7
|
* clarify that attr_name is a string for [ticket:2176]Mike Bayer2011-05-251-1/+2
|
* - remove some remaining sys.modules shenanigansrel_0_7b1Mike Bayer2011-02-121-2/+1
| | | | | | | | | - The "sqlalchemy.exceptions" alias in sys.modules has been removed. Base SQLA exceptions are available via "from sqlalchemy import exc". The "exceptions" alias for "exc" remains in "sqlalchemy" for now, it's just not patched into sys.modules.
* - whitespace removal bonanzaMike Bayer2011-01-021-12/+12
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-0/+6
| | | | | a consistent tag - AUTHORS file
* - removes the "on_" prefix.Mike Bayer2010-12-301-4/+4
|
* - inliningsMike Bayer2010-12-161-2/+15
| | | | - in particular, mapper.primary_key is a tuple now
* - Fixed recursion bug which could occur when movingMike Bayer2010-09-131-1/+1
| | | | | | | an object from one reference to another, with backrefs involved, where the initiating parent was a subclass (with its own mapper) of the previous parent.
* - lazy loads for relationship attributes now useMike Bayer2010-09-121-0/+1
| | | | | | | | | | | | | | | | | | | | | the current state, not the "committed" state, of foreign and primary key attributes when issuing SQL, if a flush is not in process. Previously, only the database-committed state would be used. In particular, this would cause a many-to-one get()-on-lazyload operation to fail, as autoflush is not triggered on these loads when the attributes are determined and the "committed" state may not be available. [ticket:1910] - A new flag on relationship(), load_on_pending, allows the lazy loader to fire off on pending objects without a flush taking place, as well as a transient object that's been manually "attached" to the session. Note that this flag blocks attribute events from taking place when an object is loaded, so backrefs aren't available until after a flush. The flag is only intended for very specific use cases.
* - collection docsMike Bayer2010-09-091-4/+5
| | | | | | | | - Added an assertion during flush which ensures that no NULL-holding identity keys were generated on "newly persistent" objects. This can occur when user defined code inadvertently triggers flushes on not-fully-loaded objects.
* fixesMike Bayer2010-09-051-1/+1
|
* - Similarly, for relationship(), foreign_keys,Mike Bayer2010-08-211-1/+2
| | | | | | | remote_side, order_by - all column-based expressions are enforced - lists of strings are explicitly disallowed since this is a very common error
* - Specifying a non-column based argumentMike Bayer2010-08-021-1/+1
| | | | | | | | for column_mapped_collection, including string, text() etc., will raise an error message that specifically asks for a column element, no longer misleads with incorrect information about text() or literal(). [ticket:1863]