summaryrefslogtreecommitdiff
path: root/test/ext
Commit message (Collapse)AuthorAgeFilesLines
* - 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
* - Fixed bug in mutable extension where :class:`.MutableDict` did notMike Bayer2014-05-141-0/+17
| | | | | 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.
* - critically, py.test for unknown reasons *SKIPS* tests that have an ↵Mike Bayer2014-05-021-27/+7
| | | | | | __init__() method. No clue. nosetests doesn't do this. concerning that other tests might have the same issue.
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-262-2/+2
| | | | Found using: https://github.com/intgr/topy
* - Added support to automap for the case where a relationship shouldMike Bayer2014-03-281-0/+7
| | | | | | | not be created between two classes that are in a joined inheritance relationship, for those foreign keys that link the subclass back to the superclass. fixes #3004
* - Fixed bug in mutable extension as well asMike Bayer2014-03-191-0/+11
| | | | | | :func:`.attributes.flag_modified` where the change event would not be propagated if the attribute had been reassigned to itself. fixes #2997
* - Fixed bug in association proxy where assigning an empty sliceMike Bayer2014-03-041-0/+7
| | | | (e.g. ``x[:] = [...]``) would fail on Py3k.
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-031-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
* - Fixed a regression in association proxy caused by :ticket:`2810` whichMike Bayer2014-02-271-1/+31
| | | | | | | | | caused a user-provided "getter" to no longer receive values of ``None`` when fetching scalar values from a target that is non-present. The check for None introduced by this change is now moved into the default getter, so a user-provided getter will also again receive values of None. re: #2810
* - Fixed bug where :class:`.AbstractConcreteBase` would fail to beMike Bayer2014-02-111-0/+78
| | | | | | | | | | | | | | | | | | | | | 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-0/+65
| | | | | | | 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/+40
| | | | | | | | | | 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.
* - docs + testsMike Bayer2014-01-051-0/+146
|
* - Fixed an extremely unlikely memory issue where when usingMike Bayer2014-01-031-2/+18
| | | | | | | | | | :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/+59
| | | | | | | | | | | 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-0/+33
| | | | | | | :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]
* - Error message when a string arg sent to :func:`.relationship` whichMike Bayer2013-12-121-0/+32
| | | | | | | doesn't resolve to a class or mapper has been corrected to work the same way as when a non-string arg is received, which indicates the name of the relationship which had the configurational error. [ticket:2888]
* - The :class:`.DeferredReflection` class has been enhanced to provideMike Bayer2013-12-031-29/+83
| | | | | | | | | | | | | | | | 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/+21
| | | | | as the string name of a class or other argument within declarative using :func:`.relationship`.
* - Fixed bug which prevented the ``serializer`` extension from workingMike Bayer2013-11-211-3/+21
| | | | | correctly with table or column names that contain non-ASCII characters. [ticket:2869]
* - catch the metadata on ScalarTest.test_scalar_proxy, this has been leaving ↵Mike Bayer2013-10-251-11/+47
| | | | | | | | itself around for a long time - association proxy now returns None for proxied scalar that is also None, rather than raising AttributeError. [ticket:2810]
* - just comment out this test, we may have to figure out if the wholeMike Bayer2013-10-211-12/+13
| | | | | "serializer" can just be ditched, or if somehow these deterministic issues can be fixed (everyone implements __reduce__ maybe?)
* - Removed some now unneeded version checks [ticket:2829] courtesy alex gaynorMike Bayer2013-09-222-8/+0
|
* - A rework to the way that "quoted" identifiers are handled, in thatMike Bayer2013-08-271-2/+4
| | | | | | | | | | | | | | | | instead of relying upon various ``quote=True`` flags being passed around, these flags are converted into rich string objects with quoting information included at the point at which they are passed to common schema constructs like :class:`.Table`, :class:`.Column`, etc. This solves the issue of various methods that don't correctly honor the "quote" flag such as :meth:`.Engine.has_table` and related methods. The :class:`.quoted_name` object is a string subclass that can also be used explicitly if needed; the object will hold onto the quoting preferences passed and will also bypass the "name normalization" performed by dialects that standardize on uppercase symbols, such as Oracle, Firebird and DB2. The upshot is that the "uppercase" backends can now work with force-quoted names, such as lowercase-quoted names and new reserved words. [ticket:2812]
* correct for missing fail() methods which were lost when we removed ↵Mike Bayer2013-08-261-25/+20
| | | | unittest.TestCase
* clean up formatting and other linting issuesMike Bayer2013-08-261-52/+51
|
* - The :class:`.CreateColumn` construct can be appled to a customMike Bayer2013-08-241-1/+17
| | | | | compilation rule which allows skipping of columns, by producing a rule that returns ``None``. Also in 0.8.3.