summaryrefslogtreecommitdiff
path: root/test/orm/inheritance/basic.py
Commit message (Collapse)AuthorAgeFilesLines
* - unit tests have been migrated from unittest to nose.Mike Bayer2009-06-101-1015/+0
| | | | | See README.unittests for information on how to run the tests. [ticket:970]
* - removed test.testing.ORMTest, test.fixtures, and allMike Bayer2009-06-021-24/+28
| | | | dependencies on those.
* - The "polymorphic discriminator" column may be part of aMike Bayer2009-05-171-0/+44
| | | | | primary key, and it will be populated with the correct discriminator value. [ticket:1300]
* remove comparison/group by on TEXT columnsMike Bayer2009-01-191-1/+1
|
* - The "clear()", "save()", "update()", "save_or_update()"Mike Bayer2009-01-171-30/+30
| | | | | | Session methods have been deprecated, replaced by "expunge_all()" and "add()". "expunge_all()" has also been added to ScopedSession.
* Flagged two versioning tests as failing on MSSQL. The flush occurs even thoughMichael Trier2009-01-031-0/+2
| | | | | | | there should be a concurrency issue. I cheated and marked these as FIXME. With this commit all MSSQL tests pass now. The work of correcting the ``fails_on`` tests begins.
* Modified fails_on testing decorator to take a reason for the failure.Michael Trier2008-12-121-1/+1
| | | | | This should assist with helping to document the reasons for testing failures. Currently unspecified failures are defaulted to 'FIXME: unknown'.
* - Query.with_polymorphic() now accepts a thirdMike Bayer2008-12-031-44/+0
| | | | | | | | | | | | | | argument "discriminator" which will replace the value of mapper.polymorphic_on for that query. Mappers themselves no longer require polymorphic_on to be set, even if the mapper has a polymorphic_identity. When not set, the mapper will load non-polymorphically by default. Together, these two features allow a non-polymorphic concrete inheritance setup to use polymorphic loading on a per-query basis, since concrete setups are prone to many issues when used polymorphically in all cases.
* - fixed a bug in declarative test which was looking for old version of historyMike Bayer2008-08-191-1/+1
| | | | | | | | | | - Added "sorted_tables" accessor to MetaData, which returns Table objects sorted in order of dependency as a list. This deprecates the MetaData.table_iterator() method. The "reverse=False" keyword argument has also been removed from util.sort_tables(); use the Python 'reversed' function to reverse the results. [ticket:1033]
* - fixed endless loop bug which could occurMike Bayer2008-08-041-0/+42
| | | | | | | | | | | | within a mapper's deferred load of inherited attributes. - declarative initialization of Columns adjusted so that non-renamed columns initialize in the same way as a non declarative mapper. This allows an inheriting mapper to set up its same-named "id" columns in particular such that the parent "id" column is favored over the child column, reducing database round trips when this value is requested.
* further refinement to the inheritance "descriptor" detection such thatMike Bayer2008-08-011-21/+39
| | | | local columns will still override superclass descriptors.
* test case to disprove [ticket:1126]Mike Bayer2008-08-011-0/+34
|
* - Fixed bug whereby the "unsaved, pending instance"Mike Bayer2008-07-311-1/+38
| | | | | | FlushError raised for a pending orphan would not take superclass mappers into account when generating the list of relations responsible for the error.
* Raised an error when sqlite version does not support default values. ↵Michael Trier2008-07-291-1/+1
| | | | Addresses #909 in a purposeful way.
* added dummy column to correct results on sqliteMike Bayer2008-07-261-1/+2
|
* - more accurate changelog messageMike Bayer2008-07-201-0/+23
| | | | - generalized the descriptor detection to any object with a __get__ attribute
* - An inheriting class can now override an attributeMike Bayer2008-07-201-1/+20
| | | | | | inherited from the base class with a plain descriptor, or exclude an inherited attribute via the include_properties/exclude_properties collections.
* - MapperProperty gets its .key attribute assigned early, in _compile_property.Mike Bayer2008-07-161-11/+13
| | | | | | | | | | | | | MapperProperty compilation is detected using a "_compiled" flag. - A mapper which inherits from another, when inheriting the columns of its inherited mapper, will use any reassigned property names specified in that inheriting mapper. Previously, if "Base" had reassigned "base_id" to the name "id", "SubBase(Base)" would still get an attribute called "base_id". This could be worked around by explicitly stating the column in each submapper as well but this is fairly unworkable and also impossible when using declarative [ticket:1111].
* added a new test illustrating a particular inheritance bug. will add ticketMike Bayer2008-07-161-5/+133
|
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-8/+9
| | | | 0.4 development continues at /sqlalchemy/branches/rel_0_4
* - merged with_polymorphic branch, which was merged with query_columns branchMike Bayer2008-03-291-0/+2
| | | | | | | | | | | | | | | | | - removes everything to do with select_table, which remains as a keyword argument synonymous with with_polymorphic=('*', select_table). - all "polymorphic" selectables find their way to Query by way of _set_select_from() now, so that all joins/aliasing/eager loads/etc. is handled consistently. Mapper has methods for producing polymorphic selectables so that Query and eagerloaders alike can get to them. - row aliasing simplified, so that they don't need to nest. they only need the source selectable and adapt to whatever incoming columns they get. - Query is more egalitarian about mappers/columns now. Still has a strong sense of "entity zero", but also introduces new unpublished/experimental _values() method which sets up a columns-only query. - Query.order_by() and Query.group_by() take *args now (also still take a list, will likely deprecate in 0.5). May want to do this for select() as well. - the existing "check for False discriminiator" "fix" was not working completely, added coverage - orphan detection was broken when the target object was a subclass of the mapper with the orphaned relation, fixed that too.
* fix datatypes #2Mike Bayer2008-03-161-1/+1
|
* - Fixed descriminator col type for poly testJason Kirtland2008-03-161-2/+7
|
* - fixed bug which was preventing synonym() attributesMike Bayer2008-03-121-0/+31
| | | | from being used with inheritance
* - fixed/covered case when using a False value as aMike Bayer2008-03-121-0/+16
| | | | polymorphic discriminator
* - Restored 2.3 compat. in lib/sqlalchemyJason Kirtland2008-01-191-1/+1
| | | | | | | - Part one of test suite fixes to run on 2.3 Lots of failures still around sets; sets.Set differs from __builtin__.set particularly in the binops. We depend on set extensively now and may need to provide a corrected sets.Set subclass on 2.3.
* - testbase is gone, replaced by testenvJason Kirtland2008-01-121-4/+4
| | | | | | - Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase - testing.db has the configured db - Fixed up the perf/* scripts
* - Undeclared SAWarnings are now fatal to tests as well.Jason Kirtland2008-01-121-4/+1
| | | | - Fixed typo that was killing runs of individual named tests.
* Reworked r4042- undeclared deprecation warnings are now *fatal* to tests. ↵Jason Kirtland2008-01-101-40/+40
| | | | No surprises.
* test suite deprecation rampageJason Kirtland2008-01-091-6/+6
|
* - mapped classes which extend "object" and do not provide anMike Bayer2007-12-291-1/+1
| | | | | | | __init__() method will now raise TypeError if non-empty *args or **kwargs are present at instance construction time (and are not consumed by any extensions such as the scoped_session mapper), consistent with the behavior of normal Python classes [ticket:908]
* - fix to cascades on polymorphic relations, such that cascadesMike Bayer2007-12-111-1/+69
| | | | | from an object to a polymorphic collection continue cascading along the set of attributes specific to each element in the collection.
* - flush() refactor merged from uow_nontree branch r3871-r3885Mike Bayer2007-12-081-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - topological.py cleaned up, presents three public facing functions which return list/tuple based structures, without exposing any internals. only the third function returns the "hierarchical" structure. when results include "cycles" or "child" items, 2- or 3- tuples are used to represent results. - unitofwork uses InstanceState almost exclusively now. new and deleted lists are now dicts which ref the actual object to provide a strong ref for the duration that they're in those lists. IdentitySet is only used for the public facing versions of "new" and "deleted". - unitofwork topological sort no longer uses the "hierarchical" version of the sort for the base sort, only for the "per-object" secondary sort where it still helps to group non-dependent operations together and provides expected insert order. the default sort deals with UOWTasks in a straight list and is greatly simplified. Tests all pass but need to see if svilen's stuff still works, one block of code in _sort_cyclical_dependencies() seems to not be needed anywhere but i definitely put it there for a reason at some point; if not hopefully we can derive more test coverage from that. - the UOWEventHandler is only applied to object-storing attributes, not scalar (i.e. column-based) ones. cuts out a ton of overhead when setting non-object based attributes. - InstanceState also used throughout the flush process, i.e. dependency.py, mapper.save_obj()/delete_obj(), sync.execute() all expect InstanceState objects in most cases now. - mapper/property cascade_iterator() takes InstanceState as its argument, but still returns lists of object instances so that they are not dereferenced. - a few tricks needed when dealing with InstanceState, i.e. when loading a list of items that are possibly fresh from the DB, you *have* to get the actual objects into a strong-referencing datastructure else they fall out of scope immediately. dependency.py caches lists of dependent objects which it loads now (i.e. history collections). - AttributeHistory is gone, replaced by a function that returns a 3-tuple of added, unchanged, deleted. these collections still reference the object instances directly for the strong-referencing reasons mentiontioned, but it uses less IdentitySet logic to generate.
* - several ORM attributes have been removed or made private:Mike Bayer2007-12-011-1/+1
| | | | | | | | mapper.get_attr_by_column(), mapper.set_attr_by_column(), mapper.pks_by_table, mapper.cascade_callable(), MapperProperty.cascade_callable(), mapper.canload() - refinements to mapper PK/table column organization, session cascading, some naming convention work
* - added support for version_id_col in conjunction with inheriting mappers.Mike Bayer2007-11-301-1/+104
| | | | | | | version_id_col is typically set on the base mapper in an inheritance relationship where it takes effect for all inheriting mappers. [ticket:883] - a little rearrangement of save_obj()
* add a polymorphic get() testMike Bayer2007-11-191-1/+2
|
* - session.refresh() and session.expire() now support an additional argumentMike Bayer2007-11-181-4/+4
| | | | | | | | | | | | | | "attribute_names", a list of individual attribute keynames to be refreshed or expired, allowing partial reloads of attributes on an already-loaded instance. - finally simplified the behavior of deferred attributes, deferred polymorphic load, session.refresh, session.expire, mapper._postfetch to all use a single codepath through query._get(), which now supports a list of individual attribute names to be refreshed. the *one* exception still remaining is mapper._get_poly_select_loader(), which may stay that way since its inline with an already processing load operation. otherwise, query._get() is the single place that all "load this instance's row" operation proceeds. - cleanup all over the place
* Migrated maxdb behavioral assumptions from unsupported to fails_onJason Kirtland2007-11-051-33/+34
|
* - Added initial version of MaxDB dialect.Jason Kirtland2007-10-231-8/+13
| | | | - All optional test Sequences are now optional=True
* - fixed three- and multi-level select and deferred inheritanceMike Bayer2007-09-291-0/+1
| | | | loading (i.e. abc inheritance with no select_table), [ticket:795]
* - mapper compilation has been reorganized such that most compilationMike Bayer2007-09-021-8/+4
| | | | | | | | | | occurs upon mapper construction. this allows us to have fewer calls to mapper.compile() and also to allow class-based properties to force a compilation (i.e. User.addresses == 7 will compile all mappers; this is [ticket:758]). The only caveat here is that an inheriting mapper now looks for its inherited mapper upon construction; so mappers within inheritance relationships need to be constructed in inheritance order (which should be the normal case anyway).
* - fixed bugs in determining proper sync clauses from custom inheritMike Bayer2007-08-301-0/+67
| | | | conditions [ticket:769]
* `from foo import (name, name)` isn't valid syntax for 2.3. ah well.Jason Kirtland2007-08-211-0/+1
| | | | omitting modules from sqlalchemy.__all__...
* merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to ↵Mike Bayer2007-07-271-0/+409
maintenance branch in branches/rel_0_3.