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 ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé
Classe « registry »

Méthode sqlalchemy.orm.registry.map_imperatively

Signature de la méthode map_imperatively

def map_imperatively(self, class_: 'Type[_O]', local_table: 'Optional[FromClause]' = None, **kw: 'Any') -> 'Mapper[_O]' 

Description

help(registry.map_imperatively)

Map a class imperatively.

In this form of mapping, the class is not scanned for any mapping
information.  Instead, all mapping constructs are passed as
arguments.

This method is intended to be fully equivalent to the now-removed
SQLAlchemy ``mapper()`` function, except that it's in terms of
a particular registry.

E.g.::

    from sqlalchemy.orm import registry

    mapper_registry = registry()

    my_table = Table(
        "my_table",
        mapper_registry.metadata,
        Column("id", Integer, primary_key=True),
    )


    class MyClass:
        pass


    mapper_registry.map_imperatively(MyClass, my_table)

See the section :ref:`orm_imperative_mapping` for complete background
and usage examples.

:param class\_: The class to be mapped.  Corresponds to the
 :paramref:`_orm.Mapper.class_` parameter.

:param local_table: the :class:`_schema.Table` or other
 :class:`_sql.FromClause` object that is the subject of the mapping.
 Corresponds to the
 :paramref:`_orm.Mapper.local_table` parameter.

:param \**kw: all other keyword arguments are passed to the
 :class:`_orm.Mapper` constructor directly.

.. seealso::

    :ref:`orm_imperative_mapping`

    :ref:`orm_declarative_mapping`



Vous êtes un professionnel et vous avez besoin d'une formation ? Mise en oeuvre d'IHM
avec Qt et PySide6
Voir le programme détaillé