summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext
Commit message (Collapse)AuthorAgeFilesLines
* - 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
* - Fixed regression regarding the declarative ``__declare_first__``Mike Bayer2015-04-241-9/+11
| | | | | | and ``__declare_last__`` accessors where these would no longer be called on the superclass of the declarative base. fixes #3383
* - Loosened some restrictions that were added to ``@declared_attr``Mike Bayer2015-03-181-9/+6
| | | | | | | | | | | | | 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
* - ensure as_declarative is part of __all__ hereMike Bayer2015-03-121-0/+1
|
* - Added a new extension suite :mod:`sqlalchemy.ext.baked`. ThisMike Bayer2015-03-112-0/+504
| | | | | | | | 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/+21
| | | | | | | 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
* - copyright 2015Mike Bayer2015-03-1013-13/+13
|
* Fix slice addressing of _AssociationList with python3Gilles Dartiguelongue2015-03-101-1/+4
|
* - repair issue in declared_attr.cascading such that within aMike Bayer2015-02-241-0/+2
| | | | | | | | | 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.
* - add MemoizedSlots, a generalized solution to using __getattr__Mike Bayer2015-01-052-3/+3
| | | | | 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/+10
|
* correctionsMike Bayer2014-12-271-1/+1
|
* Maul the evaulate & friends typoPriit Laes2014-12-191-1/+1
|
* - squash-merge the improve_toc branch, which moves all the Sphinx stylingMike Bayer2014-12-171-1371/+0
| | | | | | and extensions into an external library, and also reorganizes most large documentation pages into many small areas to reduce scrolling and better present the context into a more fine-grained hierarchy.
* - Fixed "'NoneType' object has no attribute 'concrete'" errorMike Bayer2014-10-061-1/+1
| | | | | | when using :class:`.AbstractConcreteBase` in conjunction with a subclass that declares ``__abstract__``. fixes #3185
* commentsMike Bayer2014-09-261-3/+8
|
* - refactor of declarative, break up into indiviudal methodsMike Bayer2014-09-253-338/+654
| | | | | | | | | | | | | | | | | | | | | | | 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
* - The :mod:`sqlalchemy.ext.automap` extension will now setMike Bayer2014-09-221-6/+40
| | | | | | | | | | | | | | ``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
* - Fixed an unlikely race condition observed in some exotic end-userMike Bayer2014-09-181-1/+6
| | | | | | | | setups, where the attempt to check for "duplicate class name" in declarative would hit upon a not-totally-cleaned-up weak reference related to some other class being removed; the check here now ensures the weakref still references an object before calling upon it further. fixes #3208
* - Fixed bug in ordering list where the order of items would beMike Bayer2014-09-101-2/+5
| | | | | | | | 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/+4
|\ | | | | | | https://bitbucket.org/goodscloud/sqlalchemy into pr27
| * add update() support to MutableDictMatt Chisholm2014-08-091-0/+4
| |
* | Merge branch 'mutable-dict-coerce-fix' of ↵Mike Bayer2014-08-251-3/+3
|\ \ | | | | | | | | | https://bitbucket.org/goodscloud/sqlalchemy into pr27
| * | fix MutableDict.coerceMatt Chisholm2014-08-091-3/+3
| |/ | | | | | | 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.
* | - rename _InspectionAttr to InspectionAttrMike Bayer2014-08-132-9/+9
|/
* - also add the alternate approach, name column distinctly from attribute name,Mike Bayer2014-07-161-0/+14
| | | | ref #3129
* - add a documentation section for naming conflicts, fixes #3129Mike Bayer2014-07-161-0/+44
|
* PEP8 style fixesBrian Jarrett2014-07-1313-351/+399
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-0913-13/+26
| | | | to get all flake8 passing
* Merged in therve/bug-3093/bug/3093 (pull request #24) Mike Bayer2014-07-061-1/+2
|\ | | | | Return the assigned value in MultableDict.setdefault
| * Return the assigned value in MultableDict.setdefaultThomas Herve2014-06-241-1/+2
| |
* | - Fixed bug when the declarative ``__abstract__`` flag was not beingMike Bayer2014-06-251-1/+1
|/ | | | | | | 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
* - The ``__mapper_args__`` dictionary is copied from a declarativeMike Bayer2014-05-301-1/+4
| | | | | | | | | 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
* - Fixed bug in mutable extension where :class:`.MutableDict` did notMike Bayer2014-05-141-0/+5
| | | | | report change events for the ``setdefault()`` dictionary operation. fixes #3051
* 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.
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-263-4/+4
| | | | Found using: https://github.com/intgr/topy
* - the rewording of orderinglist docs got committed by accident, finish it upMike Bayer2014-03-281-20/+12
|
* - Fixed ORM bug where changing the primary key of an object, then markingMike Bayer2014-03-281-2/+21
| | | | | | | | | | | | | it for DELETE would fail to target the correct row for DELETE. Then to compound matters, basic "number of rows matched" checks were not being performed. Both issues are fixed, however note that the "rows matched" check requires so-called "sane multi-row count" functionality; the DBAPI's executemany() method must count up the rows matched by individual statements and SQLAlchemy's dialect must mark this feature as supported, currently applies to some mysql dialects, psycopg2, sqlite only. fixes #3006 - Enabled "sane multi-row count" checking for the psycopg2 DBAPI, as this seems to be supported as of psycopg2 2.0.9.