| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- remove() on a scalar object will raise if the object
removed is not what was present.
- InstanceState can be pickled if obj() is None; this
to support the other changes in this commit
- only use trackparent flag on attributes if
single_parent or ONETOMANY; otherwise we can skip this
overhead
- attribute hasparent()/sethasparent() check that trackparent
is set, else their usage is invalid
- [bug] Fixed backref behavior when "popping" the
value off of a many-to-one in response to
a removal from a stale one-to-many - the operation
is skipped, since the many-to-one has since
been updated. [ticket:2315]
- [bug] After some years of not doing this, added
more granularity to the "is X a parent of Y"
functionality, which is used when determining
if the FK on "Y" needs to be "nulled out" as well
as if "Y" should be deleted with delete-orphan
cascade. The test now takes into account the
Python identity of the parent as well its identity
key, to see if the last known parent of Y is
definitely X. If a decision
can't be made, a StaleDataError is raised. The
conditions where this error is raised are fairly
rare, requiring that the previous parent was
garbage collected, and previously
could very well inappropriately update/delete
a record that's since moved onto a new parent,
though there may be some cases where
"silent success" occurred previously that will now
raise in the face of ambiguity.
Expiring "Y" resets the "parent" tracker, meaning
X.remove(Y) could then end up deleting Y even
if X is stale, but this is the same behavior
as before; it's advised to expire X also in that
case. [ticket:2264]
|
|
|
|
|
|
|
|
| |
sorting of persistent + pending objects during
flush would produce an illegal comparison,
if the persistent object primary key
is not a single integer. [ticket:2228]
Also in 0.6.9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
condition of being asked to UPDATE or DELETE
on a primary key value that contains NULL
in it. [ticket:2127]
- Some refinements to attribute history. More
changes are pending possibly in 0.8, but
for now history has been modified such that
scalar history doesn't have a "side effect"
of populating None for a non-present value.
This allows a slightly better ability to
distinguish between a None set and no actual
change, affects [ticket:2127] as well.
- rewriting the history tests in test_attributes to be
individual per operation/assertion. its a huge job
so this is partial for the moment.
|
|
|
|
|
|
|
|
|
| |
backrefs, typically when autoflush=False, where
the back-referenced collection wouldn't
properly handle add/removes with no net
change. Thanks to Richard Murri for the
test case + patch. [ticket:2123]
(also in 0.6.7).
|
|
|
|
|
|
|
|
|
|
|
|
| |
rare weakref callbacks during iterations.
The mutex has been removed as it apparently
can cause a reentrant (i.e. in one thread) deadlock,
perhaps when gc collects objects at the point of
iteration in order to gain more memory. It is hoped
that "dictionary changed during iteration" will
be exceedingly rare as iteration methods internally
acquire the full list of objects in a single values()
call. [ticket:2087]
|
|
|
|
|
|
| |
PASSIVE_OFF, now expresed as non-boolean symbols
- make "passive" available positionally on all get_history() methods,
call it like that
|
| |
|
|
|
|
|
|
|
|
| |
append or similar event on a collection occurs after
the parent object has been dereferenced, which
prevents the parent from being marked as "dirty"
in the session. Will commit as a warning in 0.6.
[ticket:2046]
|
|
|
|
|
|
|
| |
- add pickle/unpickle events to ORM events. these are needed
for the mutable extension.
- finish mutable extension documentation, consolidate examples,
add full descriptions
|
| |
|
|
|
|
|
| |
a consistent tag
- AUTHORS file
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- streamline interfaces, get Mutable/MutableComposite to be as minimal
in usage as possible
- docs for mutable, warnings regrarding mapper events being global
- move MutableType/mutable=True outwards, move orm tests to its
own module, note in all documentation
- still need more events/tests for correct pickling support of
composites, mutables. in the case of composites its needed
even without mutation. see [ticket:2009]
|
|
|
|
|
|
|
|
|
|
|
|
| |
full lifecycle
- composite will use events to do everything we want it to, i.e.
storing the composite in __dict__, invalidating it on change
of any of the columns.
- will reinstate mutability of composites via callable attached
to the composite - but userland code will still need to establish
change event listening on the composite itself, perhaps via
a "mutable" mixin like the scalars.py example, perhaps via
addition of descriptors to the mutable object.
|
| |
|
| |
|
| |
|
|
|
|
| |
receivers
|
|
|
|
|
|
|
|
|
| |
these are back to being part of LoaderStrategy
- simplify attribute.get()
- inline the dict get inside of attribute.__get__()
- revert some memoized attrs from InstanceState which are called in almost
all cases regardless
- inlining
|
|
|
|
| |
- add test coverage for the rare case of noload->lazyload + pickle
|
| |
|
| |
|
| |
|
|\ |
|
| | |
|
| | |
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
which occurred on an object that was clean except for
preceding mutable attribute changes would fail to strongly
reference itself in the identity map. This would cause the
object to be garbage collected, losing track of any changes
that weren't previously saved in the "mutable changes"
dictionary.
|
| |
| |
| |
| |
| | |
- fix pickling again
- other test fixes
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- simplify listen_for_events example with new system
- add "propagate", "retval", "raw" flags to attribute events. this solves the "return value"
issue as well as the "subclass" issue.
- begin thinking about event removal. Each listen() method will have a corresponding remove().
Custom listen() methods will have to package all the info onto the event function that is needed
to remove its state.
|
| |
| |
| |
| |
| |
| |
| | |
- attrbutes.py splits into attribtes.py and instrumentation.py
- all the various Event subclasses go into events.py modules
- some ideas for orm events
- move *Extension out to deprecated_interfaces
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
the current state, not the "committed" state,
of foreign and primary key attributes
when issuing SQL, if a flush is not in process.
Previously, only the database-committed state would
be used. In particular, this would cause a many-to-one
get()-on-lazyload operation to fail, as autoflush
is not triggered on these loads when the attributes are
determined and the "committed" state may not be
available. [ticket:1910]
- A new flag on relationship(), load_on_pending, allows
the lazy loader to fire off on pending objects without a
flush taking place, as well as a transient object that's
been manually "attached" to the session. Note that this
flag blocks attribute events from taking place when an
object is loaded, so backrefs aren't available until
after a flush. The flag is only intended for very
specific use cases.
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
'deleted', which prohibits the object from
being re-add()ed to the session, as previously
the object would live in the identity map
silently until its attributes were accessed.
The make_transient() function now resets this
flag along with the "key" flag.
- make_transient() can be safely called on an
already transient instance.
|
| |
| |
| |
| |
| |
| | |
cut down on extraneous stuff, cleanup
The Event class never gets instantiated and its methods stay the same
so that sphinx can get to it.
|
|/
|
|
|
|
|
|
|
| |
with methods representing events. This is self-documenting via sphinx.
- implemented new model for pool, classmanager. Most events are
one or two args, so going back to allowing any kind of *arg, **kw
signature for events - this is simpler and improves performance,
though we don't get the "we can add new kw's anytime". perhaps
there's some other way to approach that.
|
|
|
|
|
|
|
| |
including the case where the superclass is mapped
but the subclass is not. Any attempts to access
cls._sa_class_manager.mapper now raise
UnmappedClassError(). [ticket:1142]
|
|
|
|
| |
instance if that instance is "pending". [ticket:1789]
|
| |
|
| |
|
|
|
|
|
| |
cleanup with less complexity, datamembers,
method calls, blank dictionary creates.
|
|
|
|
|
|
|
|
| |
the version called by column loaders on an incomplete row (i.e.
joined table inheritance). there are more dramatic changes
that can be made here but this one is conservative so far
as far as how much we're altering how InstanceState tracks
"expired" attributes.
|
|
|
|
|
|
|
|
|
|
| |
sqlalchemy.orm.strategies, most logging calls during row
loading have been removed. These were never very helpful
and cluttered up the code.
- Some internal streamlining of object loading grants a
small speedup for large results, estimates are around
10-15%.
|
| |
|
|
|
|
| |
- remove pickle language from regular unmapped class error
|
| |
|
| |
|
|
|
|
|
| |
`__len__()` or `__nonzero__()` method resulted in state
changes. [ticket:1501]
|