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 :

Module « sqlalchemy.orm »

Classe « InstanceState »

Informations générales

Héritage

builtins.object
    InspectionAttr
        InspectionAttrInfo
            InstanceState

Définition

class InstanceState(InspectionAttrInfo):

Description [extrait de InstanceState.__doc__]

tracks state information at the instance level.

    The :class:`.InstanceState` is a key object used by the
    SQLAlchemy ORM in order to track the state of an object;
    it is created the moment an object is instantiated, typically
    as a result of :term:`instrumentation` which SQLAlchemy applies
    to the ``__init__()`` method of the class.

    :class:`.InstanceState` is also a semi-public object,
    available for runtime inspection as to the state of a
    mapped instance, including information such as its current
    status within a particular :class:`.Session` and details
    about data on individual attributes.  The public API
    in order to acquire a :class:`.InstanceState` object
    is to use the :func:`_sa.inspect` system::

        >>> from sqlalchemy import inspect
        >>> insp = inspect(some_mapped_object)

    .. seealso::

        :ref:`core_inspection_toplevel`

    

Constructeur(s)

Signature du constructeur Description
__init__(self, obj, manager)

Liste des attributs statiques

Nom de l'attribut Valeur
attrs<sqlalchemy.util.langhelpers.memoized_property object at 0x7f40cb8fb190>
callables()
expiredFalse
expired_attributesNone
extension_typesymbol('NOT_EXTENSION')
identity_tokenNone
info<sqlalchemy.util.langhelpers.memoized_property object at 0x7f40cbad16f0>
insert_orderNone
is_aliased_classFalse
is_attributeFalse
is_bundleFalse
is_clause_elementFalse
is_instanceTrue
is_mapperFalse
is_propertyFalse
is_selectableFalse
keyNone
load_optionsfrozenset()
load_pathRootRegistry(())
mapper<sqlalchemy.util.langhelpers.memoized_property object at 0x7f40cb8fb340>
modifiedFalse
parents<sqlalchemy.util.langhelpers.memoized_property object at 0x7f40cb8fb220>
runidNone
session_idNone

Liste des propriétés

Nom de la propriétéDescription
async_sessionReturn the owning :class:`_asyncio.AsyncSession` for this instance, [extrait de __doc__]
deletedReturn ``True`` if the object is :term:`deleted`. [extrait de __doc__]
detachedReturn ``True`` if the object is :term:`detached`. [extrait de __doc__]
dictReturn the instance dict used by the object. [extrait de __doc__]
has_identityReturn ``True`` if this object has an identity key. [extrait de __doc__]
identityReturn the mapped identity of the mapped object. [extrait de __doc__]
identity_keyReturn the identity key for the mapped object. [extrait de __doc__]
objectReturn the mapped object represented by this [extrait de __doc__]
pendingReturn ``True`` if the object is :term:`pending`. [extrait de __doc__]
persistentReturn ``True`` if the object is :term:`persistent`. [extrait de __doc__]
sessionReturn the owning :class:`.Session` for this instance, [extrait de __doc__]
transientReturn ``True`` if the object is :term:`transient`. [extrait de __doc__]
unloadedReturn the set of keys which do not have a loaded value. [extrait de __doc__]
unloaded_expirableReturn the set of keys which do not have a loaded value. [extrait de __doc__]
unmodifiedReturn the set of keys which have no uncommitted changes [extrait de __doc__]
was_deletedReturn True if this object is or was previously in the [extrait de __doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__getstate__(self)
__setstate__(self, state_dict)
get_history(self, key, passive)
get_impl(self, key)
obj(self)
unmodified_intersection(self, keys) Return self.unmodified.intersection(keys). [extrait de unmodified_intersection.__doc__]

Méthodes héritées de la classe InspectionAttrInfo

__init_subclass__, __subclasshook__

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__