Vous avez des améliorations (ou des corrections) à proposer pour ce document :
je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Represents loader options which modify the state of a
:class:`_query.Query` in order to affect how various mapped attributes are
loaded.
The :class:`_orm.Load` object is in most cases used implicitly behind the
scenes when one makes use of a query option like :func:`_orm.joinedload`,
:func:`.defer`, or similar. However, the :class:`_orm.Load` object
can also be used directly, and in some cases can be useful.
To use :class:`_orm.Load` directly, instantiate it with the target mapped
class as the argument. This style of usage is
useful when dealing with a :class:`_query.Query`
that has multiple entities::
myopt = Load(MyClass).joinedload("widgets")
The above ``myopt`` can now be used with :meth:`_query.Query.options`,
where it
will only take effect for the ``MyClass`` entity::
session.query(MyClass, MyOtherClass).options(myopt)
One case where :class:`_orm.Load`
is useful as public API is when specifying
"wildcard" options that only take effect for a certain class::
session.query(Order).options(Load(Order).lazyload('*'))
Above, all relationships on ``Order`` will be lazy-loaded, but other
attributes on those descendant objects will load using their normal
loader strategy.
.. seealso::
:ref:`deferred_options`
:ref:`deferred_loading_w_multiple`
:ref:`relationship_loader_options`
Améliorations / Corrections
Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Emplacement :
Description des améliorations :