summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext
Commit message (Collapse)AuthorAgeFilesLines
* Add docstring to declarative_baseFrazer McLean2016-08-061-0/+6
| | | | | Change-Id: I5ad44362515908592f1e8b1e6254a5270d43234a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/295
* Fix reference to _declarative_constructor in docstringMichael Williamson2016-07-251-1/+1
|
* Merge "Add `default` parameter for `index_property`"mike bayer2016-07-131-4/+31
|\
| * Add `default` parameter for `index_property`Jeong YunWon2016-07-111-4/+31
| | | | | | | | | | | | And force to use keyword arguments for trivial parameters in index_property Change-Id: I12a178128182f77a2d06b52d7e36f59a36b45a33
* | Fix issue with unbaking subqueriesMark Hahnenberg2016-07-121-1/+2
|/ | | | | | | | | | Fix improper capture of a loop variable inside a lambda during unbaking of subquery eager loaders, which would cause the incorrect query to be invoked. Fixes: #3743 Change-Id: I995110deb8ee2dae8540486729e1ae64578d28fc Pull-request: https://github.com/zzzeek/sqlalchemy/pull/290
* `index_property` catches IndexError as well as KeyErrorJeong YunWon2016-07-051-1/+1
| | | | | | | It was raising AttributeError for key accessing in dict, but raising IndexError for index accessing in array. Change-Id: I58a2252a9e8d7f78cabcefcbe7223a4f3a729115
* Ensure @compiles calls down to the original compilation schemeMike Bayer2016-06-291-2/+15
| | | | | | | | | | | | | | | Made a slight behavioral change in the ``sqlalchemy.ext.compiler`` extension, whereby the existing compilation schemes for an established construct would be removed if that construct was itself didn't already have its own dedicated ``__visit_name__``. This was a rare occurrence in 1.0, however in 1.1 :class:`.postgresql.ARRAY` subclasses :class:`.sqltypes.ARRAY` and has this behavior. As a result, setting up a compilation handler for another dialect such as SQLite would render the main :class:`.postgresql.ARRAY` object no longer compilable. Fixes: #3732 Change-Id: If2c1ada4eeb09157885888e41f529173902f2b49
* Add `sqlalchemy.ext.index` for indexed attributes for ORMJeong YunWon2016-06-151-0/+320
| | | | | | | | | Add `sqlalchemy.ext.index.index_property` which subscribe an index of a column with `Indexable` type. Co-authored-by: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I238c23131e4fded5dc7f7a25eb02e26008099d00 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/235
* Add schema argument to AutomapBase.prepare()Josh Marlow2016-06-021-0/+10
| | | | | | | | | This allows automap to reflect tables from a schema other than the default without the need to resort to calling MetaData.reflect directly. Change-Id: Ie73cb113bd6d115555c09c5efc33d27ad2c9c512 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/237
* Convert readthedocs link for their .org -> .io migration for hosted projectspr/278Adam Chainz2016-05-291-1/+1
| | | | | | | | As per their email ‘Changes to project subdomains’: > Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard. Test Plan: Manually visited all the links I’ve modified.
* Spelling fixes: "the a"Ville Skyttä2016-05-051-1/+1
|
* Propagate hybrid properties / infoMike Bayer2016-04-181-1/+12
| | | | | | | | | | | Keystone and others depend on the .property attribute being "mirrored" when a @hybrid_property is linked directly to a mapped attribute. Restore this linkage and also create a defined behavior for the .info dictionary; it is that of the hybrid itself. Add this behavioral change to the migration notes. Change-Id: I8ac34ef52039387230c648866c5ca15d381f7fee References: #3653
* Honor hybrid property / method docstringsMike Bayer2016-04-181-5/+25
| | | | | | | | | | | | The docstring specified on a hybrid property or method is now honored at the class level, allowing it to work with tools like Sphinx autodoc. The mechanics here necessarily involve some wrapping of expressions to occur for hybrid properties, which may cause them to appear differently using introspection. Fixes: #3653 Change-Id: I02549977fe8b2a051802eed7b00cc532fbc214e3 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/239
* Mention the correct way of adding multiple attributes which refer to the ↵pr/257Eoghan Murray2016-04-071-1/+2
| | | | same column
* - add changelog, migration, version flags and some extra notesMike Bayer2016-02-161-1/+41
| | | | to the new MutableList and MutableSet classes, fixes #3297
* Add `sqlalchemy.ext.mutable.MutableSet`pr/236Jeong YunWon2016-02-131-0/+65
| | | | from https://bitbucket.org/zzzeek/sqlalchemy/issues/3297
* Add `sqlalchemy.ext.mutable.MutableList`Jeong YunWon2016-02-131-0/+79
|
* - add more documentation to MutableDict explainingMike Bayer2016-02-101-0/+12
| | | | | | that this structure is only intended to track additions and removals from the dictionary, not recursive tracking of embedded changes. fixes #3646.
* - happy new yearMike Bayer2016-01-2914-14/+14
|
* - cross link for concrete helper classesMike Bayer2016-01-201-0/+16
| | | | | - remove redundant concrete helper docs from declarative docs, two places is enough
* - add a note that the literal_binds flag should be usedMike Bayer2016-01-201-1/+11
| | | | when cross-compiling from DDL to SQL, fixes #3615
* - fix link to types in metadata, fixes #3618Mike Bayer2016-01-101-1/+1
| | | | | | - fix "version" got whacked into "f" in core tutorial - fix short underline in automap - fix unmatched boldface in session events
* - just use *arg straight without "key" for popMike Bayer2015-12-171-2/+2
|
* - Further fixes to :ticket:`3605`, pop method on :class:`.MutableDict`,Mike Bayer2015-12-171-2/+2
| | | | | where the "default" argument was not included. fixes #3605
* - Fixed bug in baked loader system where the systemwide monkeypatchMike Bayer2015-12-151-1/+2
| | | | | | | | for setting up baked lazy loaders would interfere with other loader strategies that rely on lazy loading as a fallback, e.g. joined and subquery eager loaders, leading to ``IndexError`` exceptions at mapper configuration time. fixes #3612
* - Added support for the ``dict.pop()`` and ``dict.popitem()`` methodsMike Bayer2015-12-111-0/+10
| | | | | to the :class:`.mutable.MutableDict` class. fixes #3605
* Merge remote-tracking branch 'origin/pr/212'Mike Bayer2015-11-301-1/+2
|\
| * py2k: accept unicode literals on :func:`backref`, toopr/212Nils Philippsen2015-11-251-1/+2
| | | | | | | | | | | | | | | | Fixed bug where in Py2K a unicode literal would not be accepted as the string name of a class or other argument within declarative using :func:`.backref` on :func:`.relationship`. amends commit e6f67f48054d906856f879bc1803ea639aa4b670
* | Merge remote-tracking branch 'origin/pr/211'Mike Bayer2015-11-301-2/+2
|\ \
| * | Change generator termination from StopIteration to return.pr/211pgjones2015-10-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From [PEP 479](https://www.python.org/dev/peps/pep-0479/) the correct way to terminate a generator is to return (which implicitly raises StopIteration) rather than raise StopIteration. Without this change using sqlalchemy in python 3.5 or greater results in these warnings PendingDeprecationWarning: generator '__iter__' raised StopIteration which this commit should remove.
* | | - Fixed an issue in baked queries where the .get() method, used eitherMike Bayer2015-11-291-0/+6
| |/ |/| | | | | | | | | | | | | | | directly or within lazy loads, didn't consider the mapper's "get clause" as part of the cache key, causing bound parameter mismatches if the clause got re-generated. This clause is cached by mappers on the fly but in highly concurrent scenarios may be generated more than once when first accessed. fixes #3597
* | fix typo: Explcitly -> ExplicitlySven Schliesing2015-11-101-1/+1
|/
* - Added the :paramref:`.AssociationProxy.info` parameter to theMike Bayer2015-10-091-1/+8
| | | | | | | | | :class:`.AssociationProxy` constructor, to suit the :attr:`.AssociationProxy.info` accessor that was added in :ticket:`2971`. This is possible because :class:`.AssociationProxy` is constructed explicitly, unlike a hybrid which is constructed implicitly via the decorator syntax. fixes #3551
* Remplement Query.one() in terms of .one_or_none()pr/203Eric Siegerman2015-09-281-8/+7
| | | Thanks to Mike Bayer for suggesting a simpler refactoring.
* Fix sqlalchemy.ext.baked.Result.one_or_none() exception messagepr/202Eric Siegerman2015-09-241-1/+1
| | | Also add a couple of missing tests.
* - replicate Query.one_or_none to BakedQueryMike Bayer2015-09-241-0/+20
| | | | - changelog / version note finishing
* Correcting the Hybrid Property ExampleJason Myers2015-09-101-1/+1
| | | | | | Fixes #3528 Signed-off-by: Jason Myers <jason@jasonamyers.com>
* - Fixed bug in :class:`.AbstractConcreteBase` extension whereMike Bayer2015-07-132-2/+12
| | | | | | | | | a column setup on the ABC base which had a different attribute name vs. column name would not be correctly mapped on the final base class. The failure on 0.9 would be silent whereas on 1.0 it raised an ArgumentError, so may not have been noticed prior to 1.0. fixes #3480
* Fix code examples in automap's documentationpr/185Yuri Baida2015-06-261-5/+4
| | | Fix camelize_classname and pluralize_collection functions as they didn't work as expected.
* Missing comma in method argspr/184Benjamin Petersen2015-06-221-1/+1
|
* - automap is stableMike Bayer2015-06-181-6/+0
|
* - changelog for pr bitbucket:54Mike Bayer2015-06-031-6/+3
| | | | - alter the approach so that the initial callable is working just like add_criteria/with_criteria
* baked: Support initial args for cache keyINADA Naoki2015-06-021-2/+2
| | | | | | | | | | | | When making baked query in classmethod of declarative base, cls should be added in cache key. @as_declarative class Base(object): @classmethod def baked_query(cls): return bakery(lambda: session.query(cls), (cls,))
* - 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`.
* - fix typo MANYTOONE -> MANYTOMANY, fixes #3415Mike Bayer2015-05-051-1/+1
|
* - Repair _reinstall_default_lookups to also flip the _extended flagMike Bayer2015-05-011-1/+8
| | | | | | | | | | | | | off again so that test fixtures setup/teardown instrumentation as expected - clean up test_extendedattr.py and fix it to no longer leak itself outside by ensuring _reinstall_default_lookups is always called, part of #3408 - Fixed bug where when using extended attribute instrumentation system, the correct exception would not be raised when :func:`.class_mapper` were called with an invalid input that also happened to not be weak referencable, such as an integer. fixes #3408
* - add boldface for "viable" plus a note describing that thisMike Bayer2015-04-291-1/+7
| | | | refers to the table having a primary key. fixes #3398
* - Fixed bug in association proxy where an any()/has()Mike Bayer2015-04-281-6/+10
| | | | | | | on an relationship->scalar non-object attribute comparison would fail, e.g. ``filter(Parent.some_collection_to_attribute.any(Child.attr == 'foo'))`` fixes #3397
* - Fixed a regression regarding the :meth:`.MapperEvents.instrument_class`Mike Bayer2015-04-262-18/+13
| | | | | | | | | | | | | | | | | event where its invocation was moved to be after the class manager's instrumentation of the class, which is the opposite of what the documentation for the event explicitly states. The rationale for the switch was due to Declarative taking the step of setting up the full "instrumentation manager" for a class before it was mapped for the purpose of the new ``@declared_attr`` features described in :ref:`feature_3150`, but the change was also made against the classical use of :func:`.mapper` for consistency. However, SQLSoup relies upon the instrumentation event happening before any instrumentation under classical mapping. The behavior is reverted in the case of classical and declarative mapping, the latter implemented by using a simple memoization without using class manager. fixes #3388
* - add the "strict" version of this lookup for __abstract__ as well,Mike Bayer2015-04-241-2/+2
| | | | fixes #3383