# Path: exactonline/elements/base.py
# class ExactElement(object):
#     def __init__(self, api=None, **kwargs):
#         super(ExactElement, self).__init__(**kwargs)
# 
#         self._api = api
# 
#     def get_guid(self):
#         # Raises ObjectDoesNotExist if it cannot be found remotely.
#         raise NotImplementedError()
# 
#     def commit(self):
#         # This needs API specific work.
#         raise NotImplementedError()
# 
# Path: exactonline/exceptions.py
# class ObjectDoesNotExist(ExactOnlineError):
#     """
#     Exception named Django style.
#     """
#     pass


from .base import ExactElement
from ..exceptions import ObjectDoesNotExist
(EORALP), licensed under the LGPLv3+.
Copyright (C) 2015 Walter Doekes, OSSO B.V.
"""


class ExactRelation(ExactElement):
    def get_guid(self):
        exact_relation = self._api.relations.get(relation_code=self.get_code())
        return exact_relation['ID']

    def get_code(self):
        # The "foreign"/local relation code.
        raise NotImplementedError()

    def get_name(self):
        raise NotImplementedError()

    def get_address(self):
        # Return a dict, like:
        # {'AddressLine1': 'x', 'Postcode': 'y',
        #  'City': 'z'}
        return {}

    def assemble(self):
        # Compile a dict to be pushed.
        raise NotImplementedError()

    def commit(self):
        try:
            exact_guid = self.get_guid()

# Path: exactonline/elements/base.py
# class ExactElement(object):
#     def __init__(self, api=None, **kwargs):
#         super(ExactElement, self).__init__(**kwargs)
# 
#         self._api = api
# 
#     def get_guid(self):
#         # Raises ObjectDoesNotExist if it cannot be found remotely.
#         raise NotImplementedError()
# 
#     def commit(self):
#         # This needs API specific work.
#         raise NotImplementedError()
# 
# Path: exactonline/exceptions.py
# class ObjectDoesNotExist(ExactOnlineError):
#     """
#     Exception named Django style.
#     """
#     pass


# Path: exactonline/elements/relation.py
from .base import ExactElement
from ..exceptions import ObjectDoesNotExist

(EORALP), licensed under the LGPLv3+.
Copyright (C) 2015 Walter Doekes, OSSO B.V.
"""


class ExactRelation(ExactElement):
    def get_guid(self):
        exact_relation = self._api.relations.get(relation_code=self.get_code())
        return exact_relation['ID']

    def get_code(self):
        # The "foreign"/local relation code.
        raise NotImplementedError()

    def get_name(self):
        raise NotImplementedError()

    def get_address(self):
        # Return a dict, like:
        # {'AddressLine1': 'x', 'Postcode': 'y',
        #  'City': 'z'}
        return {}

    def assemble(self):
        # Compile a dict to be pushed.
        raise NotImplementedError()

    def commit(self):
        try:
            exact_guid = self.get_guid()

        except ObjectDoesNotExist: