summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/declarative/base.py
Commit message (Collapse)AuthorAgeFilesLines
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | 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
* - Fixed bug where :class:`.AbstractConcreteBase` would fail to beMike Bayer2014-02-111-0/+4
| | | | | | | | | | | | | | | | | | | | | 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.
* - 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.
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - Fixed an extremely unlikely memory issue where when usingMike Bayer2014-01-031-7/+48
| | | | | | | | | | :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]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-1/+1
| | | | | | | | | - 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
* - 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-261-2/+2
| | | | as possible
* - the raw 2to3 runMike Bayer2013-04-271-4/+4
| | | | - went through examples/ and cleaned out excess list() calls
* this step is not neededMike Bayer2013-02-251-3/+0
|
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/ext/declarativeDiana Clarke2012-11-191-7/+13
|
* - [bug] Fixed a disconnect that slowly evolvedMike Bayer2012-09-141-2/+6
| | | | | | | | | | | between a @declared_attr Column and a directly-defined Column on a mixin. In both cases, the Column will be applied to the declared class' table, but not to that of a joined inheritance subclass. Previously, the directly-defined Column would be placed on both the base and the sub table, which isn't typically what's desired. [ticket:2565]
* - [feature] declared_attr can now be used withMike Bayer2012-08-271-1/+4
| | | | | | attributes that are not Column or MapperProperty; including any user-defined value as well as association proxy objects. [ticket:2517]
* - [feature] Conflicts between columns onMike Bayer2012-08-271-2/+2
| | | | | | | single-inheritance declarative subclasses, with or without using a mixin, can be resolved using a new @declared_attr usage described in the documentation. [ticket:2472]
* - [bug] Declarative can now propagate a columnMike Bayer2012-08-151-0/+5
| | | | | | | | declared on a single-table inheritance subclass up to the parent class' table, when the parent class is itself mapped to a join() or select() statement, directly or via joined inheritane, and not just a Table. [ticket:2549]
* - reorganization of declarative such that file sizes are managable again.Mike Bayer2012-08-051-0/+418
the vast majority of file lines are spent on documentation, which moves into package __init__. The core declarative idea lives in base and is back down to its originally low size of under 500 lines. The various helpers and such move into api.py, and the full span of string lookup moves into a new module clsregistry. the rest of declarative only refers to two functions in clsregistry in three places inside of base. - [feature] Declarative now maintains a registry of classes by string name as well as by full module-qualified name. Multiple classes with the same name can now be looked up based on a module-qualified string within relationship(). Simple class name lookups where more than one class shares the same name now raises an informative error message. [ticket:2338] - lots of tests to ensure the new weak referencing memory management is maintained by the new class registry system. this ticket was served very well by waiting to do #2526 first, else this would have needed to be rewritten anyway.