summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/interfaces.py
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed 1.0 regression where the "parent entity" of a synonym-Mike Bayer2015-06-271-1/+1
| | | | | | | | | | | | | mapped attribute on top of an :func:`.aliased` object would resolve to the original mapper, not the :func:`.aliased` version of it, thereby causing problems for a :class:`.Query` that relies on this attribute (e.g. it's the only representative attribute given in the constructor) to figure out the correct FROM clause for the query. fixes #3466 - apply consitency to ._parententity vs. __clause_element__()._annotations['parententity'] in terms of aliased class, test it all.
* - Added a new extension suite :mod:`sqlalchemy.ext.baked`. ThisMike Bayer2015-03-111-4/+13
| | | | | | | | simple but unusual system allows for a dramatic savings in Python overhead for the construction and processing of orm :class:`.Query` objects, from query construction up through rendering of a string SQL statement. fixes #3054
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - squash-merge the final row_proc integration branch. this isMike Bayer2015-03-011-1/+2
| | | | | | | | | | | | | | | a much more modest outcome than what we started with. The work of create_row_processor() for ColumnProperty objects is essentially done at query setup time combined with some lookups in _instance_processor(). - to allow this change for deferred columns, deferred columns no longer search for themselves in the result. If they've been set up as deferred without any explicit directive to undefer them, then this is what was asked for. if we don't do this, then we're stuck with this performance penalty for all deferred columns which in the vast majority of typical use cases (e.g. loading large, legacy tables or tables with many/large very seldom used values) won't be present in the result and won't be accessed at all.
* - don't overwrite an existing _strategy_keys collection;Mike Bayer2015-02-021-1/+2
| | | | this would cause LazyLoader to be initialized twice per property.
* - doc fixesMike Bayer2015-01-061-8/+5
|
* - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-051-8/+43
| | | | | for memoization on a class that uses slots. - apply many more __slots__. mem use for nova now at 46% savings
* - strategies + declarativeMike Bayer2015-01-041-0/+2
|
* - start trying to move things into __slots__. This seems to reduce theslotsMike Bayer2015-01-041-1/+3
| | | | | size of the many per-column objects we're hitting, but somehow the overall memory is hardly being reduced at all in initial testing
* - remove some old cruftMike Bayer2014-09-071-51/+85
| | | | | | - prop.compare() isn't needed; replace with prop._with_parent() for relationships - update docs in orm/interfaces
* - reorganize how create_row_processor() communicates up toMike Bayer2014-08-291-7/+10
| | | | | | | | instances(), using a named tuple it can assign to directly. this way we never have to worry about that structure changing anymore, though we are still having it append (key, fn) which is kind of awkward. - inline _populators() into instance(), it's a little verbose but saves an fn call
* - major refactoring/inlining to loader.instances(), though not reallyMike Bayer2014-08-281-6/+6
| | | | | | | | | | | any speed improvements :(. code is in a much better place to be run into C, however - The ``proc()`` callable passed to the ``create_row_processor()`` method of custom :class:`.Bundle` classes now accepts only a single "row" argument. - Deprecated event hooks removed: ``populate_instance``, ``create_instance``, ``translate_row``, ``append_result`` - the getter() idea is somewhat restored; see ref #3175
* - The :meth:`.InspectionAttr.info` collection is now moved down toMike Bayer2014-08-131-22/+0
| | | | | | | | :class:`.InspectionAttr`, where in addition to being available on all :class:`.MapperProperty` objects, it is also now available on hybrid properties, association proxies, when accessed via :attr:`.Mapper.all_orm_descriptors`. fixes #2971
* - rename _InspectionAttr to InspectionAttrMike Bayer2014-08-131-2/+2
|
* flake8 cleanupMike Bayer2014-08-131-3/+3
|
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-17/+17
| | | | 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
* - Removed stale names from ``sqlalchemy.orm.interfaces.__all__`` andMike Bayer2014-02-261-4/+4
| | | | | | refreshed with current names, so that an ``import *`` from this module again works. fixes #2975
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - add some tests for propagate of wildcard lazyloadMike Bayer2013-10-061-3/+0
|
* 11th hour realization that Load() needs to do the _chop_path() thing asMike Bayer2013-10-061-0/+3
| | | | well. this probably has some bugs
* - merge ticket_1418 branch, [ticket:1418]Mike Bayer2013-10-061-276/+45
| | | | | | | | | | | | | - The system of loader options has been entirely rearchitected to build upon a much more comprehensive base, the :class:`.Load` object. This base allows any common loader option like :func:`.joinedload`, :func:`.defer`, etc. to be used in a "chained" style for the purpose of specifying options down a path, such as ``joinedload("foo").subqueryload("bar")``. The new system supersedes the usage of dot-separated path names, multiple attributes within options, and the usage of ``_all()`` options. - Added a new load option :func:`.orm.load_only`. This allows a series of column names to be specified as loading "only" those attributes, deferring the rest.
* - A new construct :class:`.Bundle` is added, which allows for specificationMike Bayer2013-10-031-0/+3
| | | | | | | | | | | | | | | | of groups of column expressions to a :class:`.Query` construct. The group of columns are returned as a single tuple by default. The behavior of :class:`.Bundle` can be overridden however to provide any sort of result processing to the returned row. One example included is :attr:`.Composite.Comparator.bundle`, which applies a bundled form of a "composite" mapped attribute. [ticket:2824] - The :func:`.composite` construct now maintains the return object when used in a column-oriented :class:`.Query`, rather than expanding out into individual columns. This makes use of the new :class:`.Bundle` feature internally. This behavior is backwards incompatible; to select from a composite column which will expand out, use ``MyClass.some_composite.clauses``.
* move FAQ to the docs, [ticket:2133]Mike Bayer2013-08-211-1/+20
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-97/+34
| | | | | | | | | - 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
* - rework PropComparator.adapted() to be PropComparator.adapt_to_entity(),Mike Bayer2013-06-171-6/+15
| | | | | | | passes in AliasedInsp and allows more flexibility. - rework the AliasedClass/AliasedInsp relationship so that AliasedInsp has all state and functionality. AliasedClass is just a facade. [ticket:2756]
* - blow away context._attributesMike Bayer2013-06-021-3/+3
| | | | | - to account for query._attributes/context.attributes, just pass the attributes dict directly to the PathRegistry methods
* import of "sqlalchemy" and "sqlalchemy.orm" works.Mike Bayer2013-04-271-0/+1
|
* - the raw 2to3 runMike Bayer2013-04-271-2/+2
| | | | - went through examples/ and cleaned out excess list() calls
* Fixed `__repr__()` on mapper property constructsMike Bayer2013-04-111-1/+1
| | | | | | to work before the object is initialized, so that Sphinx builds with recent Sphinx versions can read them.
* A meaningful :attr:`.QueryableAttribute.info` attribute isMike Bayer2013-03-091-0/+10
| | | | | | | | added, which proxies down to the ``.info`` attribute on either the :class:`.schema.Column` object if directly present, or the :class:`.MapperProperty` otherwise. The full behavior is documented and ensured by tests to remain stable. [ticket:2675]
* Can set/change the "cascade" attribute on a :func:`.relationship`Mike Bayer2013-03-021-1/+1
| | | | | | construct after it's been constructed already. This is not a pattern for normal use but we like to change the setting for demonstration purposes in tutorials.
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* Extended the :doc:`/core/inspection` system so that all Python descriptorsMike Bayer2012-12-291-2/+63
| | | | | | | | associated with the ORM or its extensions can be retrieved. This fulfills the common request of being able to inspect all :class:`.QueryableAttribute` descriptors in addition to extension types such as :class:`.hybrid_property` and :class:`.AssociationProxy`. See :attr:`.Mapper.all_orm_descriptors`.
* - refactor of pathing mechanics, to address #2614, #2617Mike Bayer2012-12-011-16/+17
| | | | | | | | | | | | | | | | | | | - paths now store Mapper + MapperProperty now instead of string key, so that the parent mapper for the property is known, supports same-named properties on multiple subclasses - the Mapper within the path is now always relevant to the property to the right of it. PathRegistry does the translation now, instead of having all the outside users of PathRegistry worry about it, to produce a path that is much more consistent. Paths are now consistent with mappings in all cases. Special logic to get at "with_polymorphic" structures and such added also. - AliasedClass now has two modes, "use_mapper_path" and regular; "use_mapper_path" is for all those situations where we put an AliasedClass in for a plain class internally, and want it to "path" with the plain mapper. - The AliasedInsp is now the first class "entity" for an AliasedClass, and is passed around internally and used as attr._parententity and such. it is the AliasedClass analogue for Mapper.
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-18/+23
|
* - some naming changes on PropComparator, Comparator:Mike Bayer2012-10-251-6/+7
| | | | | | | | | | | | | 1. all Comparators now have "parent" which is always the parent mapper or AliasedClass instance 2. only RelationshipProperty.Comparator has "mapper" now, which is the target mapper 3. The names "parententity" and "parentmapper" are underscored also improved the message with the "neither comparator nor instruentedattribute...." to include the classname + attribute name
* - [feature] Conflicts between columns onMike Bayer2012-08-271-1/+6
| | | | | | | single-inheritance declarative subclasses, with or without using a mixin, can be resolved using a new @declared_attr usage described in the documentation. [ticket:2472]
* - [feature] Added support for .info dictionary argument toMike Bayer2012-08-241-0/+16
| | | | | | column_property(), relationship(), composite(). All MapperProperty classes have an auto-creating .info dict available overall.
* - fix the labeled column with column_expression() issue, finishes [ticket:1534]Mike Bayer2012-08-181-7/+70
| | | | | | | | | | | - epic documentation sweep for new operator system, making ORM links consistent and complete, full documentation and examples for type/SQL expression feature - type_coerce() explicitly accepts BindParamClause objects - change UserDefinedType to coerce the other side to itself by default as this is much more likely what's desired - make coerce_compared_type() fully public on all types - have profiling run the test no matter what so that the test_zoomarks don't fail when callcounts are missing
* - all tests passMike Bayer2012-08-131-3/+0
|
* - develop new system of applying custom operators to ColumnElement classes. ↵Mike Bayer2012-08-131-0/+3
| | | | | | resembles that of the ORM so far.
* - [feature] ORM entities can be passedMike Bayer2012-07-231-0/+2
| | | | | | | to select() as well as the select_from(), correlate(), and correlate_except() methods, where they will be unwrapped into selectables. [ticket:2245]
* - move ext to relative importsMike Bayer2012-07-171-4/+2
|
* - totally remove _entity_info and _extended_entity_info, replacing all usageMike Bayer2012-07-161-3/+3
| | | | with inspect()
* - express most of the orm.util functions in terms of the inspection systemMike Bayer2012-07-161-5/+16
| | | | | | | | | | | | | | - 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 mapper-level UOW functionality straight into unitofwork also. there'sMike Bayer2012-07-141-28/+26
| | | | | | no need for this to be per-mapper. can't move dependency init off of property though as this init needs to happen up front, added a test to prove it.
* - [moved] The InstrumentationManager interfaceMike Bayer2012-06-241-76/+3
| | | | | | | | | | | | | and the entire related system of alternate class implementation is now moved out to sqlalchemy.ext.instrumentation. This is a seldom used system that adds significant complexity and overhead to the mechanics of class instrumentation. The new architecture allows it to remain unused until InstrumentationManager is actually imported, at which point it is bootstrapped into the core.
* - move all of orm to use absolute importsMike Bayer2012-06-231-18/+13
| | | | | | | | - 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
* - [feature] The of_type() construct on attributesMike Bayer2012-06-201-112/+75
| | | | | | | | | | | | | | | | | | | | | | | | now accepts aliased() class constructs as well as with_polymorphic constructs, and works with query.join(), any(), has(), and also eager loaders subqueryload(), joinedload(), contains_eager() [ticket:2438] [ticket:1106] - a rewrite of the query path system to use an object based approach for more succinct usage. the system has been designed carefully to not add an excessive method overhead. - [feature] select() features a correlate_except() method, auto correlates all selectables except those passed. Is needed here for the updated any()/has() functionality. - remove some old cruft from LoaderStrategy, init(),debug_callable() - use a namedtuple for _extended_entity_info. This method should become standard within the orm internals - some tweaks to the memory profile tests, number of runs can be customized to work around pysqlite's very annoying behavior - try to simplify PropertyOption._get_paths(), rename to _process_paths(), returns a single list now. overall works more completely as was needed for of_type() functionality