summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative
Commit message (Collapse)AuthorAgeFilesLines
* Add docstring to declarative_basepr/295Frazer McLean2016-07-261-1/+4
|
* Mention the correct way of adding multiple attributes which refer to the ↵pr/257Eoghan Murray2016-04-071-1/+2
| | | | same column
* - happy new yearMike Bayer2016-01-294-4/+4
|
* - cross link for concrete helper classesMike Bayer2016-01-201-0/+16
| | | | | - remove redundant concrete helper docs from declarative docs, two places is enough
* 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
* - 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
* - 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
|
* - 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-104-4/+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.
* - strategies + declarativeMike Bayer2015-01-041-0/+10
|
* 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
* - 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
* PEP8 style fixesBrian Jarrett2014-07-134-93/+96
|
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-094-4/+8
| | | | to get all flake8 passing
* - 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
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-2/+2
| | | | Found using: https://github.com/intgr/topy
* - extensive cross-linking of relationship options with their documentation ↵Mike Bayer2014-02-161-1/+5
| | | | | | sections - convert all paramter references in relationship documentation to :paramref:
* - use an OrderedDict here so that tests are more deterministicMike Bayer2014-02-141-2/+2
|
* - Fixed bug where :class:`.AbstractConcreteBase` would fail to beMike Bayer2014-02-113-4/+43
| | | | | | | | | | | | | | | | | | | | | fully usable within declarative relationship configuration, as its string classname would not be available in the registry of classnames at mapper configuration time. The class now explicitly adds itself to the class regsitry, and additionally both :class:`.AbstractConcreteBase` as well as :class:`.ConcreteBase` set themselves up *before* mappers are configured within the :func:`.configure_mappers` setup, using the new :meth:`.MapperEvents.before_configured` event. [ticket:2950] - Added new :meth:`.MapperEvents.before_configured` event which allows an event at the start of :func:`.configure_mappers`, as well as ``__declare_first__()`` hook within declarative to complement ``__declare_last__()``. - modified how after_configured is invoked; we just make a dispatch() not actually connected to any mapper. this makes it easier to also invoke before_configured correctly. - improved the ComparableEntity fixture to handle collections that are sets.
* this example doesn't work, we don't really have a solution for this as far ↵Mike Bayer2014-02-101-31/+0
| | | | as automating this pattern
* - Fixed bug where the :class:`.AutomapBase` class of theMike Bayer2014-02-081-3/+25
| | | | | | | new automap extension would fail if classes were pre-arranged in single or potentially joined inheritance patterns. The repaired joined inheritance issue could also potentially apply when using :class:`.DeferredReflection` as well.
* - Support is improved for supplying a :func:`.join` construct as theMike Bayer2014-01-221-0/+4
| | | | | | | | | | target of :paramref:`.relationship.secondary` for the purposes of creating very complex :func:`.relationship` join conditions. The change includes adjustments to query joining, joined eager loading to not render a SELECT subquery, changes to lazy loading such that the "secondary" target is properly included in the SELECT, and changes to declarative to better support specification of a join() object with classes as targets.
* - happy new yearMike Bayer2014-01-054-4/+4
|
* - Fixed an extremely unlikely memory issue where when usingMike Bayer2014-01-032-19/+63
| | | | | | | | | | :class:`.DeferredReflection` to define classes pending for reflection, if some subset of those classes were discarded before the :meth:`.DeferredReflection.prepare` method were called to reflect and map the class, a strong reference to the class would remain held within the declarative internals. This internal collection of "classes to map" now uses weak references against the classes themselves.
* - A quasi-regression where apparently in 0.8 you can set a class-levelMike Bayer2014-01-021-1/+20
| | | | | | | | | | | attribute on declarative to simply refer directly to an :class:`.InstrumentedAttribute` on a superclass or on the class itself, and it acts more or less like a synonym; in 0.9, this fails to set up enough bookkeeping to keep up with the more liberalized backref logic from :ticket:`2789`. Even though this use case was never directly considered, it is now detected by declarative at the "setattr()" level as well as when setting up a subclass, and the mirrored/renamed attribute is now set up as a :func:`.synonym` instead. [ticket:2900]
* - Declarative does an extra check to detect if the sameMike Bayer2013-12-271-1/+14
| | | | | | | :class:`.Column` is mapped multiple times under different properties (which typically should be a :func:`.synonym` instead) or if two or more :class:`.Column` objects are given the same name, raising a warning if this condition is detected. [ticket:2828]
* - The :class:`.DeferredReflection` class has been enhanced to provideMike Bayer2013-12-032-38/+75
| | | | | | | | | | | | | | | | automatic reflection support for the "secondary" table referred to by a :func:`.relationship`. "secondary", when specified either as a string table name, or as a :class:`.Table` object with only a name and :class:`.MetaData` object will also be included in the reflection process when :meth:`.DeferredReflection.prepare` is called. [ticket:2865] - clsregistry._resolver() now uses a stateful _class_resolver() class in order to handle the work of mapping strings to objects. This is to provide for simpler extensibility, namely a ._resolvers collection of ad-hoc name resolution functions; the DeferredReflection class adds its own resolver here in order to handle relationship(secondary) names which generate new Table objects.
* Fixed bug where in Py2K a unicode literal would not be acceptedMike Bayer2013-11-291-1/+1
| | | | | as the string name of a class or other argument within declarative using :func:`.relationship`.
* Fixed a syntax error in example code.Hyunjun Kim2013-11-291-1/+1
|
* Merge pull request #46 from vrajmohan/mastermike bayer2013-11-292-8/+8
|\ | | | | More fixes for cross references and reducing warnings (3rd wave)
| * Fix cross referencesVraj Mohan2013-11-172-8/+8
| |
* | - add more explicit docs for relationship mixin, [ticket:2876]Mike Bayer2013-11-271-4/+50
|/
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-142-2/+3
| | | | | | | | | - 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
* tpoMike Bayer2013-07-201-9/+9
|
* - Improved the examples in ``examples/generic_associations``, includingMike Bayer2013-07-192-1/+41
| | | | | | | | | | | | | | | that ``discriminator_on_association.py`` makes use of single table inheritance do the work with the "discriminator". Also added a true "generic foreign key" example, which works similarly to other popular frameworks in that it uses an open-ended integer to point to any other table, foregoing traditional referential integrity. While we don't recommend this pattern, information wants to be free. Also in 0.8.3. - Added a convenience class decorator :func:`.as_declarative`, is a wrapper for :func:`.declarative_base` which allows an existing base class to be applied using a nifty class-decorated approach. Also in 0.8.3.
* ORM descriptors such as hybrid properties can now be referencedMike Bayer2013-07-021-10/+12
| | | | | | by name in a string argument used with ``order_by``, ``primaryjoin``, or similar in :func:`.relationship`, in addition to column-bound attributes. [ticket:2761]
* - fix a dict while iterate mutationMike Bayer2013-05-271-1/+1
| | | | | - illustrate how OrderedDict can catch these, but commented out to save function overhead
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-262-3/+3
| | | | as possible
* - fixing AbstractConcreteBase import in docstring, 0.9diana2013-05-261-1/+1
| | | branch, [ticket:2717]
* - the raw 2to3 runMike Bayer2013-04-273-8/+8
| | | | - went through examples/ and cleaned out excess list() calls