def test_get_adapter(self):
        from pyamf.adapters import _decimal

        self.assertTrue(adapters.get_adapter("decimal") is _decimal)
Example #2
0
# Copyright (c) The PyAMF Project.
# See LICENSE for details.
"""
Elixir adapter module. Elixir adds a number of properties to the mapped
instances.

@see: U{Elixir homepage<http://elixir.ematia.de>}
@since: 0.6
"""

import elixir.entity

import pyamf
from pyamf import adapters

adapter = adapters.get_adapter('sqlalchemy.orm')

adapter.class_checkers.append(elixir.entity.is_entity)


class ElixirAdapter(adapter.SaMappedClassAlias):

    EXCLUDED_ATTRS = adapter.SaMappedClassAlias.EXCLUDED_ATTRS + [
        '_global_session'
    ]

    def getCustomProperties(self):
        adapter.SaMappedClassAlias.getCustomProperties(self)

        self.descriptor = self.klass._descriptor
        self.parent_descriptor = None
Example #3
0
# See LICENSE for details.

"""
Elixir adapter module. Elixir adds a number of properties to the mapped
instances.

@see: U{Elixir homepage<http://elixir.ematia.de>}
@since: 0.6
"""

import elixir.entity

import pyamf
from pyamf import adapters

adapter = adapters.get_adapter('sqlalchemy.orm')

adapter.class_checkers.append(elixir.entity.is_entity)


class ElixirAdapter(adapter.SaMappedClassAlias):

    EXCLUDED_ATTRS = adapter.SaMappedClassAlias.EXCLUDED_ATTRS + [
        '_global_session']

    def getCustomProperties(self):
        adapter.SaMappedClassAlias.getCustomProperties(self)

        self.descriptor = self.klass._descriptor
        self.parent_descriptor = None
Example #4
0
    def test_get_adapter(self):
        from pyamf.adapters import _decimal

        self.assertTrue(adapters.get_adapter('decimal') is _decimal)