summaryrefslogtreecommitdiff
path: root/test/ext
Commit message (Collapse)AuthorAgeFilesLines
* - 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
| |
* | Merge branch 'mutable-dict-coerce-fix' of ↵Mike Bayer2014-08-251-0/+53
|\ \ | | | | | | | | | https://bitbucket.org/goodscloud/sqlalchemy into pr27
| * | fix MutableDict.coerceMatt Chisholm2014-08-091-0/+53
| |/ | | | | | | 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.
* | - The :meth:`.InspectionAttr.info` collection is now moved down toMike Bayer2014-08-131-0/+18
| | | | | | | | | | | | | | | | :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
* | - ensure all tests are named test_*Mike Bayer2014-07-301-1/+1
| |
* | fix test ordering issuesMike Bayer2014-07-273-66/+42
|/
* - more pg8000 tests passingMike Bayer2014-07-251-2/+2
|
* Merged in therve/bug-3093/bug/3093 (pull request #24) Mike Bayer2014-07-061-2/+2
|\ | | | | Return the assigned value in MultableDict.setdefault
| * Return the assigned value in MultableDict.setdefaultThomas Herve2014-06-241-2/+2
| |
* | - Fixed bug when the declarative ``__abstract__`` flag was not beingMike Bayer2014-06-251-1/+24
|/ | | | | | | distinguished for when it was actually the value ``False``. The ``__abstract__`` flag needs to acutally evaluate to a True value at the level being tested. fixes #3097
* - Additional checks have been added for the case where an inheritingMike Bayer2014-06-201-1/+1
| | | | | | | | | | mapper is implicitly combining one of its column-based attributes with that of the parent, where those columns normally don't necessarily share the same value. This is an extension of an existing check that was added via :ticket:`1892`; however this new check emits only a warning, instead of an exception, to allow for applications that may be relying upon the existing behavior. fixes #3042
* - fix this test for MySQL, needs InnoDBMike Bayer2014-05-301-3/+7
|
* - The ``__mapper_args__`` dictionary is copied from a declarativeMike Bayer2014-05-301-0/+27
| | | | | | | | | mixin or abstract class when accessed, so that modifications made to this dictionary by declarative itself won't conflict with that of other mappings. The dictionary is modified regarding the ``version_id_col`` and ``polymorphic_on`` arguments, replacing the column within with the one that is officially mapped to the local class/table. fixes #3062