Participer au site avec un Tip
Rechercher
 

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 :

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé
Classe « Query »

Méthode sqlalchemy.orm.Query.with_parent

Signature de la méthode with_parent

def with_parent(self, instance: 'object', property: 'Optional[attributes.QueryableAttribute[Any]]' = None, from_entity: 'Optional[_ExternalEntityType[Any]]' = None) -> 'Self' 

Description

help(Query.with_parent)

Add filtering criterion that relates the given instance
to a child object or collection, using its attribute state
as well as an established :func:`_orm.relationship()`
configuration.

.. deprecated:: 2.0 The :meth:`_orm.Query.with_parent` method is considered legacy as of the 1.x series of SQLAlchemy and becomes a legacy construct in 2.0. Use the :func:`_orm.with_parent` standalone construct. (Background on SQLAlchemy 2.0 at: :ref:`migration_20_toplevel`)

The method uses the :func:`.with_parent` function to generate
the clause, the result of which is passed to
:meth:`_query.Query.filter`.

Parameters are the same as :func:`.with_parent`, with the exception
that the given property can be None, in which case a search is
performed against this :class:`_query.Query` object's target mapper.

:param instance:
  An instance which has some :func:`_orm.relationship`.

:param property:
  Class bound attribute which indicates
  what relationship from the instance should be used to reconcile the
  parent/child relationship.

:param from_entity:
  Entity in which to consider as the left side.  This defaults to the
  "zero" entity of the :class:`_query.Query` itself.



Vous êtes un professionnel et vous avez besoin d'une formation ? RAG (Retrieval-Augmented Generation)
et Fine Tuning d'un LLM
Voir le programme détaillé