summaryrefslogtreecommitdiff
path: root/test/orm/inheritance
Commit message (Collapse)AuthorAgeFilesLines
* - Fixed regression where we apparently still create an implicitMike Bayer2014-01-021-0/+1
| | | | | | | | | | alias when saying query(B).join(B.cs), where "C" is a joined inh class; however, this implicit alias was created only considering the immediate left side, and not a longer chain of joins along different joined-inh subclasses of the same base. As long as we're still implicitly aliasing in this case, the behavior is dialed back a bit so that it will alias the right side in a wider variety of cases. [ticket:2903]
* - Fixed bug when using joined table inheritance from a table to aMike Bayer2013-12-161-14/+65
| | | | | | | select/alias on the base, where the PK columns were also not same named; the persistence system would fail to copy primary key values from the base table to the inherited table upon INSERT. [ticket:2885]
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-173-6/+0
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* An overhaul of expression handling for special symbols particularlyMike Bayer2013-10-231-1/+0
| | | | | | | | | | with conjunctions, e.g. ``None`` :func:`.expression.null` :func:`.expression.true` :func:`.expression.false`, including consistency in rendering NULL in conjunctions, "short-circuiting" of :func:`.and_` and :func:`.or_` expressions which contain boolean constants, and rendering of boolean constants and expressions as compared to "1" or "0" for backends that don't feature ``true``/``false`` constants. [ticket:2804]
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-0/+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
* - additional fix for [ticket:2750] where on an update, we make sure theMike Bayer2013-06-301-2/+33
| | | | value is present
* add better tests for [ticket:2750]Mike Bayer2013-06-301-3/+45
|
* A warning is emitted when trying to flush an object of an inheritedMike Bayer2013-06-301-3/+23
| | | | | mapped class where the polymorphic discriminator has been assigned to a value that is invalid for the class. [ticket:2750]
* The resolution of :class:`.ForeignKey` objects to theirMike Bayer2013-06-231-1/+2
| | | | | | | | | | | | | | | | | | target :class:`.Column` has been reworked to be as immediate as possible, based on the moment that the target :class:`.Column` is associated with the same :class:`.MetaData` as this :class:`.ForeignKey`, rather than waiting for the first time a join is constructed, or similar. This along with other improvements allows earlier detection of some foreign key configuration issues. Also included here is a rework of the type-propagation system, so that it should be reliable now to set the type as ``None`` on any :class:`.Column` that refers to another via :class:`.ForeignKey` - the type will be copied from the target column as soon as that other column is associated, and now works for composite foreign keys as well. [ticket:1765]
* Fixed bug in polymorphic SQL generation where multiple joined-inheritanceMike Bayer2013-06-151-1/+91
| | | | | | | entities against the same base class joined to each other as well would not track columns on the base table independently of each other if the string of joins were more than two entities long. Also in 0.8.2. [ticket:2759]
* - Fixed an obscure bug where the wrong results would beMike Bayer2013-06-072-13/+134
| | | | | | | | | | | fetched when joining/joinedloading across a many-to-many relationship to a single-table-inheriting subclass with a specific discriminator value, due to "secondary" rows that would come back. The "secondary" and right-side tables are now inner joined inside of parenthesis for all ORM joins on many-to-many relationships so that the left->right join can accurately filtered. [ticket:2369]
* dial back the default "flatness" a bit, it will be there for joinedload and ↵Mike Bayer2013-06-062-11/+55
| | | | | | | query.join(), but if you're dealing with aliased() or with_polymorphic() you need to say "flat=True". Just the one flag though, "flat" implies "aliased".
* a test for what's breaking, plus a non-working fix for it...Mike Bayer2013-06-051-1/+47
|
* - improve overlapping selectables, apply to both query and relationshipMike Bayer2013-06-041-5/+4
| | | | | | - clean up inspect() calls within query._join() - make sure join.alias(flat) propagates - fix almost all assertion tests
* - eager loadsMike Bayer2013-06-041-60/+38
| | | | - two suite of SQL assertions converted
* getting things to join without subqueries, but some glitches in the compiler ↵Mike Bayer2013-06-021-1/+24
| | | | | | step when we do query.count() are showing
* most of ORM passing...Mike Bayer2013-05-041-2/+2
|
* - the raw 2to3 runMike Bayer2013-04-279-177/+177
| | | | - went through examples/ and cleaned out excess list() calls
* and a lot of tests. five fail without the changeMike Bayer2013-04-261-0/+264
|
* order the properties here to get the SQL to be deterministicMike Bayer2013-04-201-7/+7
|
* Fixed bug whereby ORM would run the wrong kind ofMike Bayer2013-04-111-2/+49
| | | | | | | | | query when refreshing an inheritance-mapped class where the superclass was mapped to a non-Table object, like a custom join() or a select(), running a query that assumed a hierarchy that's mapped to individual Table-per-class. [ticket:2697]
* Fixed bug when a query of the form:Mike Bayer2013-04-091-0/+1
| | | | | | | | | | | ``query(SubClass).options(subqueryload(Baseclass.attrname))``, where ``SubClass`` is a joined inh of ``BaseClass``, would fail to apply the ``JOIN`` inside the subquery on the attribute load, producing a cartesian product. The populated results still tended to be correct as additional rows are just ignored, so this issue may be present as a performance degradation in applications that are otherwise working correctly. [ticket:2699]
* - Fixed bug in unit of work whereby a joined-inheritanceMike Bayer2013-04-011-0/+67
| | | | | | | | | | | subclass could insert the row for the "sub" table before the parent table, if the two tables had no ForeignKey constraints set up between them. Also in 0.7.11. [ticket:2689] - fix a glitch in the assertsql.CompiledSQL fixture regarding when a multiparam compiledSQL is used within an AllOf - add a new utility function randomize_unitofwork() which does the function of --reversetop
* - refactor of pathing mechanics, to address #2614, #2617Mike Bayer2012-12-013-36/+248
| | | | | | | | | | | | | | | | | | | - paths now store Mapper + MapperProperty now instead of string key, so that the parent mapper for the property is known, supports same-named properties on multiple subclasses - the Mapper within the path is now always relevant to the property to the right of it. PathRegistry does the translation now, instead of having all the outside users of PathRegistry worry about it, to produce a path that is much more consistent. Paths are now consistent with mappings in all cases. Special logic to get at "with_polymorphic" structures and such added also. - AliasedClass now has two modes, "use_mapper_path" and regular; "use_mapper_path" is for all those situations where we put an AliasedClass in for a plain class internally, and want it to "path" with the plain mapper. - The AliasedInsp is now the first class "entity" for an AliasedClass, and is passed around internally and used as attr._parententity and such. it is the AliasedClass analogue for Mapper.
* getting everything to pass againMike Bayer2012-09-275-5/+10
|
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-2716-59/+60
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* - fix for pypyMike Bayer2012-08-251-4/+8
| | | | - more oracle fixes
* a few oracle fixesMike Bayer2012-08-251-1/+2
|
* fixes for pg9Mike Bayer2012-08-221-2/+2
|
* - [bug] with_polymorphic() produces JOINsMike Bayer2012-08-011-0/+99
| | | | | | | in the correct order and with correct inheriting tables in the case of sending multi-level subclasses in an arbitrary order or with intermediary classes missing. [ticket:1900]
* - [feature] Added reduce_columns() methodMike Bayer2012-07-282-6/+3
| | | | | | | | | | | | | | | to select() construct, replaces columns inline using the util.reduce_columns utility function to remove equivalent columns. reduce_columns() also adds "with_only_synonyms" to limit the reduction just to those columns which have the same name. The deprecated fold_equivalents() feature is removed [ticket:1729]. - [feature] Added with_labels and reduce_columns keyword arguments to Query.subquery(), to provide two alternate strategies for producing queries with uniquely- named columns. [ticket:1729].
* -whitespace bonanza, contdMike Bayer2012-07-288-258/+258
|
* - with InstanceState more public, underscore all its methodsMike Bayer2012-07-181-1/+1
| | | | | that change object state as these aren't intended for public use.
* pypy doesn't seem to decrement __subclasses__(), just skip for nowMike Bayer2012-07-171-0/+3
|
* - [bug] Fixed bug mostly local to newMike Bayer2012-07-141-8/+18
| | | | | | | | | | | | | AbstractConcreteBase helper where the "type" attribute from the superclass would not be overridden on the subclass to produce the "reserved for base" error message, instead placing a do-nothing attribute there. This was inconsistent vs. using ConcreteBase as well as all the behavior of classical concrete mappings, where the "type" column from the polymorphic base would be explicitly disabled on subclasses, unless overridden explicitly.
* - [feature] *Very limited* support forMike Bayer2012-07-142-6/+65
| | | | | | | | | | | | | | inheriting mappers to be GC'ed when the class itself is deferenced. The mapper must not have its own table (i.e. single table inh only) without polymorphic attributes in place. This allows for the use case of creating a temporary subclass of a declarative mapped class, with no table or mapping directives of its own, to be garbage collected when dereferenced by a unit test. [ticket:2526]
* - [bug] ORM will perform extra effort to determineMike Bayer2012-07-051-66/+103
| | | | | | | | | that an FK dependency between two tables is not significant during flush if the tables are related via joined inheritance and the FK dependency is not part of the inherit_condition, saves the user a use_alter directive. [ticket:2527]
* - [feature] The of_type() construct on attributesMike Bayer2012-06-202-128/+104
| | | | | | | | | | | | | | | | | | | | | | | | now accepts aliased() class constructs as well as with_polymorphic constructs, and works with query.join(), any(), has(), and also eager loaders subqueryload(), joinedload(), contains_eager() [ticket:2438] [ticket:1106] - a rewrite of the query path system to use an object based approach for more succinct usage. the system has been designed carefully to not add an excessive method overhead. - [feature] select() features a correlate_except() method, auto correlates all selectables except those passed. Is needed here for the updated any()/has() functionality. - remove some old cruft from LoaderStrategy, init(),debug_callable() - use a namedtuple for _extended_entity_info. This method should become standard within the orm internals - some tweaks to the memory profile tests, number of runs can be customized to work around pysqlite's very annoying behavior - try to simplify PropertyOption._get_paths(), rename to _process_paths(), returns a single list now. overall works more completely as was needed for of_type() functionality
* - [feature] New standalone function with_polymorphic()Mike Bayer2012-04-231-0/+113
| | | | | | | | | | | provides the functionality of query.with_polymorphic() in a standalone form. It can be applied to any entity within a query, including as the target of a join in place of the "of_type()" modifier. [ticket:2333] - redo a large portion of the inheritance docs in terms of declarative, new with_polymorphic() function - upgrade examples/inheritance/polymorph, rename to "joined"
* - merge attribute flag overhaul for [ticket:2358]Mike Bayer2012-04-231-5/+3
|
* - merged #1401 branch from bitbucketMike Bayer2012-04-221-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - resolved some serious speed hits I missed, we need to ensure only deannotated columns are used in the local/remote collections and soforth so that hash lookups against mapped columns don't dig into __eq__() - fix some other parity mismatches regarding stuff from [ticket:2453], including finding another case where _deep_annotate() was doing the wrong thing, new tests. - [feature] Major rewrite of relationship() internals now allow join conditions which include columns pointing to themselves within composite foreign keys. A new API for very specialized primaryjoin conditions is added, allowing conditions based on SQL functions, CAST, etc. to be handled by placing the annotation functions remote() and foreign() inline within the expression when necessary. Previous recipes using the semi-private _local_remote_pairs approach can be upgraded to this new approach. [ticket:1401]
| * many fixes but still can't get heuristics to work as well as what's existing,Mike Bayer2012-02-111-1/+5
| | | | | | | | tests still failing
* | another oracle failureMike Bayer2012-03-141-0/+4
| |
* | add autoincrements here hopefully fixing oracle testMike Bayer2012-03-141-4/+8
| |
* | - expand the check to determine if a selectable column is embeddedMike Bayer2012-02-291-3/+64
| | | | | | | | | | | | | | | | | | | | in the corresponding selectable to take into account clones of the target column. fixes [ticket:2419] - have _make_proxy() copy out the _is_clone_of attribute on the new column so that even more corresponding_column() checks work as expected for cloned elements. - add a new test fixture so that mapped tests can be specified using declarative.
* | remove the "produce test" approach from the polymorphic_rel tests,Mike Bayer2012-02-282-1520/+1609
| | | | | | | | | | break out fixtures into a separate module which will be used by some future test suites as well
* | - fix some unclear phrases in query regarding polymorphic,Mike Bayer2012-02-164-1308/+1872
| | | | | | | | | | | | | | | | slowly approaching [ticket:2333] - pep8 most of the big old polymorphic tests, break lots of the inheritance/test_query tests into individual tests since these are the ones that are easily broken when screwing with query
* | modify these tests to ensure the CASE output is being used fullyMike Bayer2012-02-141-16/+22
|/
* - [bug] Fixed bug whereby a table-bound ColumnMike Bayer2012-01-221-0/+32
| | | | | | | | | | | object named "<a>_<b>" which matched a column labeled as "<tablename>_<colname>" could match inappropriately when targeting in a result set row. [ticket:2377] - requires that we change the tuple format in RowProxy. Makes an improvement to the cases tested against an unpickled RowProxy as well though doesn't solve the problem there entirely.
* - rework the test suite to make use of SkipTest for tests skipped, ↵Mike Bayer2012-01-221-2/+2
| | | | | | | unsupported, etc. so that we can get an accurate picture what's really running/not, what's installed on jenkins, etc. Tested in cpython 2.7 so far, we'll see what jenkins says about other platforms