| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The :meth:`.AssociationProxy.any`, :meth:`.AssociationProxy.has`
and :meth:`.AssociationProxy.contains`
comparison methods now support linkage to an attribute that
is itself also an :class:`.AssociationProxy`, recursively.
After some initial attempts it's clear that the any() / has()
of AssociationProxy needed to be reworked into a generic
_criterion_exists() to allow this to work recursively without
excess complexity. For the case of the multi-linked associationproxy,
the usual checks of "any()" / "has()" correctness simply don't
take place; for a single-link association proxy the error
checking logic that takes place in relationship() has been
ported to the local any() / has() methods.
Change-Id: Ic5aed2a4e910b8138a737d215430113c31cce856
Fixes: #3769
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improved the association proxy list collection so that premature
autoflush against a newly created association object can be prevented
in the case where ``list.append()`` is being used, and a lazy load
would be invoked when the association proxy accesses the endpoint
collection. The endpoint collection is now accessed first before
the creator is invoked to produce the association object.
Change-Id: I008a6dbdfe5b1c0dfd02189c3d954d83a65f3fc5
Fixes: #3941
|
|
|
|
|
|
|
|
|
|
|
| |
Corrects some warnings and adds tox config. Adds DeprecationWarning
to the error category. Large sweep for string literals w/ backslashes
as this is common in docstrings
Co-authored-by: Andrii Soldatenko
Fixes: #3886
Change-Id: Ia7c838dfbbe70b262622ed0803d581edc736e085
Pull-request: https://github.com/zzzeek/sqlalchemy/pull/337
|
|
|
|
| |
Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
From [PEP 479](https://www.python.org/dev/peps/pep-0479/) the correct way to
terminate a generator is to return (which implicitly raises StopIteration)
rather than raise StopIteration.
Without this change using sqlalchemy in python 3.5 or greater results in
these warnings
PendingDeprecationWarning: generator '__iter__' raised StopIteration
which this commit should remove.
|
|
|
|
|
|
|
|
|
| |
:class:`.AssociationProxy` constructor, to suit the
:attr:`.AssociationProxy.info` accessor that was added in
:ticket:`2971`. This is possible because :class:`.AssociationProxy`
is constructed explicitly, unlike a hybrid which is constructed
implicitly via the decorator syntax.
fixes #3551
|
|
|
|
|
|
|
| |
on an relationship->scalar non-object attribute comparison would fail,
e.g.
``filter(Parent.some_collection_to_attribute.any(Child.attr == 'foo'))``
fixes #3397
|
| |
|
| |
|
|
|
|
|
| |
for memoization on a class that uses slots.
- apply many more __slots__. mem use for nova now at 46% savings
|
| |
|
| |
|
|
|
|
| |
to get all flake8 passing
|
|
|
|
| |
(e.g. ``x[:] = [...]``) would fail on Py3k.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
itself
around for a long time
- association proxy now returns None for proxied scalar that is also None, rather
than raising AttributeError. [ticket:2810]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
scalar values, for comparisons to None to also take into account
the association record itself being non-present, in addition to the
existing test for the scalar endpoint on the association record
being NULL. Previously, comparing ``Cls.scalar == None`` would return
records for which ``Cls.associated`` were present and
``Cls.associated.scalar`` is None, but not rows for which
``Cls.associated`` is non-present. More significantly, the
inverse operation ``Cls.scalar != None`` *would* return ``Cls``
rows for which ``Cls.associated`` was non-present.
Additionally, added a special use case where you
can call ``Cls.scalar.has()`` with no arguments,
when ``Cls.scalar`` is a column-based value - this returns whether or
not ``Cls.associated`` has any rows present, regardless of whether
or not ``Cls.associated.scalar`` is NULL or not.
[ticket:2751]
|
| |
|
|
|
|
| |
as possible
|
| |
|
| |
|
|
|
|
| |
- went through examples/ and cleaned out excess list() calls
|
| |
|
|
|
|
|
|
|
|
| |
associated with the ORM or its extensions can be retrieved.
This fulfills the common request of being able to inspect
all :class:`.QueryableAttribute` descriptors in addition to
extension types such as :class:`.hybrid_property` and
:class:`.AssociationProxy`. See :attr:`.Mapper.all_orm_descriptors`.
|
| |
|
| |
|
|
|
|
| |
such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
dictionary to use a duck typing approach, i.e.
checks for "keys", to discern between update({})
and update((a, b)). Previously, passing a
dictionary that had tuples as keys would be misinterpreted
as a sequence. [ticket:2275]
|
|
|
|
| |
any()/has(), MapperProperty
|
|
|
|
|
|
|
|
| |
examples, querying,
etc., part of [ticket:2246]
- add some accessors to AssociationProxy for attributes, test in join(), [ticket:2236]
- update relationship docs to talk about callables, part of [ticket:2246]
|
|
|
|
|
|
|
| |
any(), has(), and contains() when proxying
a many-to-one scalar attribute to a one-to-many
collection (i.e. the reverse of the 'typical'
association proxy use case) [ticket:2054]
|
| |
|
|
|
|
|
| |
a consistent tag
- AUTHORS file
|
|
|
|
|
|
| |
relationship(), to eliminate confusion over the relational
algebra term. relation() however will remain available
in equal capacity for the foreseeable future. [ticket:1740]
|
|
|
|
|
| |
.has(), .contains(), ==, !=, thanks to Scott Torborg.
[ticket:1372]
|
|
|
|
|
|
|
|
| |
association_proxy is now (lazy_collection, creator,
value_attr, association_proxy), adding a fourth argument
that is the parent AssociationProxy argument. Allows
serializability and subclassing of the built in collections.
[ticket:1259]
|
|
|
|
|
|
| |
pickleable. A user-defined proxy_factory however
is still not pickleable unless it defines __getstate__
and __setstate__. [ticket:1446]
|
|
|
|
|
|
|
|
| |
testing issues,
and also addresses a significant chunk of py3k deprecations. It's mainly
expicit __hash__ methods. Additionally, most usage of sets/dicts to store columns uses
util-based placeholder names.
|
| |
|
| |
|
|
|
|
| |
(sets.Set-based collections & DB-API returns still work.)
|
| |
|
| |
|
|
|
|
| |
- dict/set/list proxies are now docstring'd like their python counterparts
|
|
|
|
| |
0.4 development continues at /sqlalchemy/branches/rel_0_4
|
|
|
|
|
|
| |
more closely follow builtin (2.4+) set semantics. Formerly any set duck-type
was accepted, now only types or subtypes of set, frozenset or the collection
type itself are accepted.
|