summaryrefslogtreecommitdiff
path: root/test/ext
Commit message (Collapse)AuthorAgeFilesLines
* Add schema argument to AutomapBase.prepare()Josh Marlow2016-06-021-1/+36
| | | | | | | | | 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
* change "psotgresql" to 'postgresql' in decoratorpr/272Mark Sandan2016-05-061-1/+1
|
* Deprecate Mapper.order_byMike Bayer2016-04-191-2/+2
| | | | | | | | | | | This is an old parameter no longer relevant to how SQLAlchemy works, once the Query object was introduced. By deprecating it we establish that we aren't supporting non-working use cases and that we encourage applications to move off of the use of this parameter. Fixes: #3394 Change-Id: I25b9a38142a1537bbcb27d3e8b66a8b265140072
* Propagate hybrid properties / infoMike Bayer2016-04-181-0/+53
| | | | | | | | | | | 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-6/+269
| | | | | | | | | | | | 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
* Add `sqlalchemy.ext.mutable.MutableSet`pr/236Jeong YunWon2016-02-131-1/+195
| | | | from https://bitbucket.org/zzzeek/sqlalchemy/issues/3297
* Add `sqlalchemy.ext.mutable.MutableList`Jeong YunWon2016-02-131-1/+218
|
* - Further fixes to :ticket:`3605`, pop method on :class:`.MutableDict`,Mike Bayer2015-12-171-1/+16
| | | | | where the "default" argument was not included. fixes #3605
* - Fixed bug in baked loader system where the systemwide monkeypatchMike Bayer2015-12-151-0/+18
| | | | | | | | 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/+32
| | | | | to the :class:`.mutable.MutableDict` class. fixes #3605
* Merge remote-tracking branch 'origin/pr/212'Mike Bayer2015-11-301-0/+23
|\
| * py2k: accept unicode literals on :func:`backref`, toopr/212Nils Philippsen2015-11-251-0/+23
| | | | | | | | | | | | | | | | 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
* | - close the sessionMike Bayer2015-11-291-0/+2
| |
* | - Fixed an issue in baked queries where the .get() method, used eitherMike Bayer2015-11-291-0/+24
|/ | | | | | | | | 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
* - rewrite the docs and add a test for the bake_queries=TrueMike Bayer2015-11-191-2/+46
| | | | | | | relationship flag; this flag *does* have an effect when the baked lazy loader plugin has been invoked. clarify the intent of this flag as an "opt out" but only has an effect when the baked system is loaded anyway. fixes #3572
* - exclude this from unpredictable gcMike Bayer2015-10-111-1/+1
|
* - Added the :paramref:`.AssociationProxy.info` parameter to theMike Bayer2015-10-091-0/+20
| | | | | | | | | :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
* Merge remote-tracking branch 'origin/pr/203'Mike Bayer2015-10-091-1/+2
|\
| * Remplement Query.one() in terms of .one_or_none()pr/203Eric Siegerman2015-09-281-1/+2
| | | | | | Thanks to Mike Bayer for suggesting a simpler refactoring.
* | - The system by which a :class:`.Column` considers itself to be anMike Bayer2015-10-071-2/+1
|/ | | | | | | | | | | | | | | | | "auto increment" column has been changed, such that autoincrement is no longer implicitly enabled for a :class:`.Table` that has a composite primary key. In order to accommodate being able to enable autoincrement for a composite PK member column while at the same time maintaining SQLAlchemy's long standing behavior of enabling implicit autoincrement for a single integer primary key, a third state has been added to the :paramref:`.Column.autoincrement` parameter ``"auto"``, which is now the default. fixes #3216 - The MySQL dialect no longer generates an extra "KEY" directive when generating CREATE TABLE DDL for a table using InnoDB with a composite primary key with AUTO_INCREMENT on a column that isn't the first column; to overcome InnoDB's limitation here, the PRIMARY KEY constraint is now generated with the AUTO_INCREMENT column placed first in the list of columns.
* Fix sqlalchemy.ext.baked.Result.one_or_none() exception messagepr/202Eric Siegerman2015-09-241-3/+26
| | | Also add a couple of missing tests.
* - replicate Query.one_or_none to BakedQueryMike Bayer2015-09-241-0/+20
| | | | - changelog / version note finishing
* - Fixed bug in :class:`.AbstractConcreteBase` extension whereMike Bayer2015-07-131-0/+30
| | | | | | | | | 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
* - Fixed an unexpected-use regression whereby custom :class:`.Comparator`Mike Bayer2015-06-111-0/+1
| | | | | | | | | | objects that made use of the ``__clause_element__()`` method and returned an object that was an ORM-mapped :class:`.InstrumentedAttribute` and not explicitly a :class:`.ColumnElement` would fail to be correctly handled when passed as an expression to :meth:`.Session.query`. The logic in 0.9 happened to succeed on this, so this use case is now supported. fixes #3448
* - repair these tests to use the global manager_of_class fn,Mike Bayer2015-06-071-6/+7
| | | | | | as test_customfinder_pass at least does not provide the alternate ext manager and in all cases it's the global function that counts
* - changelog for pr bitbucket:54Mike Bayer2015-06-031-0/+20
| | | | - alter the approach so that the initial callable is working just like add_criteria/with_criteria
* - Fixed regression in the :mod:`sqlalchemy.ext.mutable` extensionMike Bayer2015-05-211-9/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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`.
* flake8 some testsMike Bayer2015-05-211-56/+84
|
* - Repair _reinstall_default_lookups to also flip the _extended flagMike Bayer2015-05-011-149/+309
| | | | | | | | | | | | | 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
* - turn sessions in ResultTest to autocommit=True just to get themMike Bayer2015-05-011-7/+7
| | | | to clean up automatically. references #3407
* - Fixed bug in association proxy where an any()/has()Mike Bayer2015-04-281-2/+28
| | | | | | | 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-261-1/+30
| | | | | | | | | | | | | | | | | 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
* - Fixed regression regarding the declarative ``__declare_first__``Mike Bayer2015-04-242-2/+88
| | | | | | and ``__declare_last__`` accessors where these would no longer be called on the superclass of the declarative base. fixes #3383
* - Fixed more regressions caused by NEVER_SET; comparisonsMike Bayer2015-04-201-10/+13
| | | | | | | | | to transient objects with attributes unset would leak NEVER_SET, and negated_contains_or_equals would do so for any transient object as the comparison used only the committed value. Repaired the NEVER_SET cases, fixes #3371, and also made negated_contains_or_equals() use state_attr_by_column() just like a non-negated comparison, fixes #3374
* - The "auto-attach" feature of constraints such as :class:`.UniqueConstraint`Mike Bayer2015-03-241-0/+35
| | | | | | | | | | and :class:`.CheckConstraint` has been further enhanced such that when the constraint is associated with non-table-bound :class:`.Column` objects, the constraint will set up event listeners with the columns themselves such that the constraint auto attaches at the same time the columns are associated with the table. This in particular helps in some edge cases in declarative but is also of general use. fixes #3341
* - Loosened some restrictions that were added to ``@declared_attr``Mike Bayer2015-03-181-0/+33
| | | | | | | | | | | | | objects, such that they were prevented from being called outside of the declarative process; this is related to the enhancements of #3150 which allow ``@declared_attr`` to return a value that is cached based on the current class as it's being configured. The exception raise has been removed, and the behavior changed so that outside of the declarative process, the function decorated by ``@declared_attr`` is called every time just like a regular ``@property``, without using any caching, as none is available at this stage. fixes #3331
* - Added a new extension suite :mod:`sqlalchemy.ext.baked`. ThisMike Bayer2015-03-111-0/+768
| | | | | | | | 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
* - Fixed bug where using an ``__abstract__`` mixin in the middleMike Bayer2015-03-101-0/+41
| | | | | | | of a declarative inheritance hierarchy would prevent attributes and configuration being correctly propagated from the base class to the inheriting class. fixes #3219 fixes #3240
* Fix slice addressing of _AssociationList with python3Gilles Dartiguelongue2015-03-101-0/+16
|
* - repair issue in declared_attr.cascading such that within aMike Bayer2015-02-241-0/+53
| | | | | | | | | subclass, the value returned by the descriptor is not available because the superclass is already mapped with the InstrumentedAttribute, until the subclass is mapped. We add a setattr() to set up that attribute so that the __mapper_args__ hook and possibly others have access to the "cascaded" version of the attribute within the call.
* - fix test for new eventsMike Bayer2015-01-041-1/+1
|
* - some profile changes likely due to the change in event listeningticket_3100Mike Bayer2014-12-081-2/+0
| | | | on engines
* - Fixed "'NoneType' object has no attribute 'concrete'" errorMike Bayer2014-10-061-0/+29
| | | | | | when using :class:`.AbstractConcreteBase` in conjunction with a subclass that declares ``__abstract__``. fixes #3185
* - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-252-5/+281
| | | | | | | | | | | | | | | | | | | | | | | that are now affixed to _MapperConfig - declarative now creates column copies ahead of time so that they are ready to go for a declared_attr - overhaul of declared_attr; memoization, cascading modifier - A relationship set up with :class:`.declared_attr` on a :class:`.AbstractConcreteBase` base class will now be configured on the abstract base mapping automatically, in addition to being set up on descendant concrete classes as usual. fixes #2670 - The :class:`.declared_attr` construct has newly improved behaviors and features in conjunction with declarative. The decorated function will now have access to the final column copies present on the local mixin when invoked, and will also be invoked exactly once for each mapped class, the returned result being memoized. A new modifier :attr:`.declared_attr.cascading` is added as well. fixes #3150 - the original plan for #3150 has been scaled back; by copying mixin columns up front and memoizing, we don't actually need the "map properties later" thing. - full docs + migration notes
* - flake8 all of test/ext/declarativeMike Bayer2014-09-235-427/+543
|
* - The :mod:`sqlalchemy.ext.automap` extension will now setMike Bayer2014-09-221-1/+67
| | | | | | | | | | | | | | ``cascade="all, delete-orphan"`` automatically on a one-to-many relationship/backref where the foreign key is detected as containing one or more non-nullable columns. This argument is present in the keywords passed to :func:`.automap.generate_relationship` in this case and can still be overridden. Additionally, if the :class:`.ForeignKeyConstraint` specifies ``ondelete="CASCADE"`` for a non-nullable or ``ondelete="SET NULL"`` for a nullable set of columns, the argument ``passive_deletes=True`` is also added to the relationship. Note that not all backends support reflection of ondelete, but backends that do include Postgresql and MySQL. fixes #3210
* pep8/flake8Mike Bayer2014-09-221-42/+59
|
* - Fixed bug in ordering list where the order of items would beMike Bayer2014-09-101-0/+22
| | | | | | | | 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
* Merge branch 'mutable-dict-update' of ↵Mike Bayer2014-08-251-0/+12
|\ | | | | | | https://bitbucket.org/goodscloud/sqlalchemy into pr27
| * add update() support to MutableDictMatt Chisholm2014-08-091-0/+12
| |