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 ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « Session »

Méthode sqlalchemy.orm.Session.get_one

Signature de la méthode get_one

def get_one(self, entity: '_EntityBindKey[_O]', ident: '_PKIdentityArgument', *, options: 'Optional[Sequence[ORMOption]]' = None, populate_existing: 'bool' = False, with_for_update: 'ForUpdateParameter' = None, identity_token: 'Optional[Any]' = None, execution_options: 'OrmExecuteOptionsParameter' = immutabledict({}), bind_arguments: 'Optional[_BindArguments]' = None) -> '_O' 

Description

help(Session.get_one)

Return exactly one instance based on the given primary key
identifier, or raise an exception if not found.

Raises ``sqlalchemy.orm.exc.NoResultFound`` if the query
selects no rows.

For a detailed documentation of the arguments see the
method :meth:`.Session.get`.

.. versionadded:: 2.0.22

:return: The object instance.

.. seealso::

    :meth:`.Session.get` - equivalent method that instead
      returns ``None`` if no row was found with the provided primary
      key



Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les fondamentaux
Voir le programme détaillé