# Path: transmute_core/compat.py
# def getfullargspec(func):
# 
# Path: transmute_core/exceptions.py
# class SerializationException(APIException):
#     """
#     this exceptions signifies an exception with
#     serializing values.
#     """


from ..compat import all_string_types, string_type
from ..exceptions import SerializationException
from schematics.exceptions import BaseError
from schematics.types import DecimalType, DateTimeType
from decimal import Decimal
from datetime import datetime
            raise SerializationException(str(e))

    def dump(self, cls, obj):
        try:
            return self.SERIALIZER.to_primitive(obj)
        except BaseError as e:
            raise SerializationException(str(e))


class DateTimeSerializer(object):

    SERIALIZER = DateTimeType()

    def can_handle(self, cls):
        return issubclass(cls, datetime)

    @staticmethod
    def to_json_schema(cls):
        return {"type": "string", "format": "date-time"}

    def load(self, cls, obj):
        try:
            return self.SERIALIZER.to_native(obj)
        except BaseError as e:
            raise SerializationException(str(e))

    def dump(self, cls, obj):
        try:
            return self.SERIALIZER.to_primitive(obj)
        except BaseError as e:

# Path: transmute_core/compat.py
# def getfullargspec(func):
# 
# Path: transmute_core/exceptions.py
# class SerializationException(APIException):
#     """
#     this exceptions signifies an exception with
#     serializing values.
#     """


# Path: transmute_core/object_serializers/primitive_serializer.py
from ..compat import all_string_types, string_type
from ..exceptions import SerializationException
from schematics.exceptions import BaseError
from schematics.types import DecimalType, DateTimeType
from decimal import Decimal
from datetime import datetime

            raise SerializationException(str(e))

    def dump(self, cls, obj):
        try:
            return self.SERIALIZER.to_primitive(obj)
        except BaseError as e:
            raise SerializationException(str(e))


class DateTimeSerializer(object):

    SERIALIZER = DateTimeType()

    def can_handle(self, cls):
        return issubclass(cls, datetime)

    @staticmethod
    def to_json_schema(cls):
        return {"type": "string", "format": "date-time"}

    def load(self, cls, obj):
        try:
            return self.SERIALIZER.to_native(obj)
        except BaseError as e:
            raise SerializationException(str(e))

    def dump(self, cls, obj):
        try:
            return self.SERIALIZER.to_primitive(obj)
        except BaseError as e:

            raise SerializationException(str(e))