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 ? Programmation Python
Les compléments
Voir le programme détaillé
Classe « KeyFuncDict »

Constructeur sqlalchemy.orm.KeyFuncDict.__init__

Signature de la constructeur __init__

def __init__(self, keyfunc: 'Callable[[Any], Any]', *dict_args: 'Any', ignore_unpopulated_attribute: 'bool' = False) -> 'None' 

Description

help(KeyFuncDict.__init__)

Create a new collection with keying provided by keyfunc.

keyfunc may be any callable that takes an object and returns an object
for use as a dictionary key.

The keyfunc will be called every time the ORM needs to add a member by
value-only (such as when loading instances from the database) or
remove a member.  The usual cautions about dictionary keying apply-
``keyfunc(object)`` should return the same output for the life of the
collection.  Keying based on mutable properties can result in
unreachable instances "lost" in the collection.



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