| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
See README.unittests for information on how to run
the tests. [ticket:970]
|
|
|
|
| |
dependencies on those.
|
|
|
|
|
| |
primary key, and it will be populated with the correct
discriminator value. [ticket:1300]
|
| |
|
|
|
|
|
|
| |
Session methods have been deprecated, replaced by
"expunge_all()" and "add()". "expunge_all()" has also
been added to ScopedSession.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This should assist with helping to document the reasons for testing failures.
Currently unspecified failures are defaulted to 'FIXME: unknown'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
- 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]
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
local columns will still override superclass descriptors.
|
| |
|
|
|
|
|
|
| |
FlushError raised for a pending orphan would not take
superclass mappers into account when generating
the list of relations responsible for the error.
|
|
|
|
| |
Addresses #909 in a purposeful way.
|
| |
|
|
|
|
| |
- generalized the descriptor detection to any object with a __get__ attribute
|
|
|
|
|
|
| |
inherited from the base class with a plain descriptor,
or exclude an inherited attribute via the
include_properties/exclude_properties collections.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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].
|
| |
|
|
|
|
| |
0.4 development continues at /sqlalchemy/branches/rel_0_4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
| |
|
|
|
|
| |
from being used with inheritance
|
|
|
|
| |
polymorphic discriminator
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
- 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
|
|
|
|
| |
- Fixed typo that was killing runs of individual named tests.
|
|
|
|
| |
No surprises.
|
| |
|
|
|
|
|
|
|
| |
__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]
|
|
|
|
|
| |
from an object to a polymorphic collection continue cascading
along the set of attributes specific to each element in the collection.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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()
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
"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
|
| |
|
|
|
|
| |
- All optional test Sequences are now optional=True
|
|
|
|
| |
loading (i.e. abc inheritance with no select_table), [ticket:795]
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
| |
conditions [ticket:769]
|
|
|
|
| |
omitting modules from sqlalchemy.__all__...
|
|
maintenance branch in branches/rel_0_3.
|