How to use the persistent._compat.use_c_impl function in persistent

To help you get started, we’ve selected a few persistent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zopefoundation / persistent / persistent / interfaces.py View on Github external
"""

from zope.interface import Interface
from zope.interface import Attribute

from persistent._compat import use_c_impl


# Allowed values for _p_state. Use the C constants if available (which
# are defined in cPersistence --- there is no cInterfaces --- so we
# need to pass the corresponding ``mod_name``), otherwise define some
# values here.
GHOST = use_c_impl(-1, 'GHOST', mod_name='persistent.persistence')
UPTODATE = use_c_impl(0, 'UPTODATE', mod_name='persistent.persistence')
CHANGED = use_c_impl(1, 'CHANGED', mod_name='persistent.persistence')
STICKY = use_c_impl(2, 'STICKY', mod_name='persistent.persistence')


OID_TYPE = SERIAL_TYPE = bytes

class IPersistent(Interface):
    """Python persistent interface

    A persistent object can be in one of several states:

    - Unsaved

      The object has been created but not saved in a data manager.

      In this state, the _p_changed attribute is non-None and false
      and the _p_jar attribute is None.
github zopefoundation / persistent / persistent / interfaces.py View on Github external
##############################################################################
"""Persistence Interfaces
"""

from zope.interface import Interface
from zope.interface import Attribute

from persistent._compat import use_c_impl


# Allowed values for _p_state. Use the C constants if available (which
# are defined in cPersistence --- there is no cInterfaces --- so we
# need to pass the corresponding ``mod_name``), otherwise define some
# values here.
GHOST = use_c_impl(-1, 'GHOST', mod_name='persistent.persistence')
UPTODATE = use_c_impl(0, 'UPTODATE', mod_name='persistent.persistence')
CHANGED = use_c_impl(1, 'CHANGED', mod_name='persistent.persistence')
STICKY = use_c_impl(2, 'STICKY', mod_name='persistent.persistence')


OID_TYPE = SERIAL_TYPE = bytes

class IPersistent(Interface):
    """Python persistent interface

    A persistent object can be in one of several states:

    - Unsaved

      The object has been created but not saved in a data manager.

      In this state, the _p_changed attribute is non-None and false
github zopefoundation / persistent / persistent / interfaces.py View on Github external
"""Persistence Interfaces
"""

from zope.interface import Interface
from zope.interface import Attribute

from persistent._compat import use_c_impl


# Allowed values for _p_state. Use the C constants if available (which
# are defined in cPersistence --- there is no cInterfaces --- so we
# need to pass the corresponding ``mod_name``), otherwise define some
# values here.
GHOST = use_c_impl(-1, 'GHOST', mod_name='persistent.persistence')
UPTODATE = use_c_impl(0, 'UPTODATE', mod_name='persistent.persistence')
CHANGED = use_c_impl(1, 'CHANGED', mod_name='persistent.persistence')
STICKY = use_c_impl(2, 'STICKY', mod_name='persistent.persistence')


OID_TYPE = SERIAL_TYPE = bytes

class IPersistent(Interface):
    """Python persistent interface

    A persistent object can be in one of several states:

    - Unsaved

      The object has been created but not saved in a data manager.

      In this state, the _p_changed attribute is non-None and false
      and the _p_jar attribute is None.
github zopefoundation / persistent / persistent / interfaces.py View on Github external
#
##############################################################################
"""Persistence Interfaces
"""

from zope.interface import Interface
from zope.interface import Attribute

from persistent._compat import use_c_impl


# Allowed values for _p_state. Use the C constants if available (which
# are defined in cPersistence --- there is no cInterfaces --- so we
# need to pass the corresponding ``mod_name``), otherwise define some
# values here.
GHOST = use_c_impl(-1, 'GHOST', mod_name='persistent.persistence')
UPTODATE = use_c_impl(0, 'UPTODATE', mod_name='persistent.persistence')
CHANGED = use_c_impl(1, 'CHANGED', mod_name='persistent.persistence')
STICKY = use_c_impl(2, 'STICKY', mod_name='persistent.persistence')


OID_TYPE = SERIAL_TYPE = bytes

class IPersistent(Interface):
    """Python persistent interface

    A persistent object can be in one of several states:

    - Unsaved

      The object has been created but not saved in a data manager.