# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


from django.db import models
from tmapi.exceptions import ModelConstraintException
from construct import Construct

    class Meta:
        abstract = True
        app_label = 'tmapi'

    def get_reifier (self):
        """Returns the reifier of this construct.

        :rtype: `Topic`

        """
        return self.reifier

    def set_reifier (self, reifier):
        """Sets the reifier of this consutrct.

        The specified reifier **must not** reify another information
        item.

        :param reifier: the topic that should reify this construct or
          None if an existing reifier should be removed
        :type reifier: `Topic` or None
        :raises `ModelConstraintException`: if the specified `reifier`
          reifies another construct

        """
        if reifier is None:
            reified = None
        else:
            if self.get_topic_map() != reifier.topic_map:

# Path: tmapi/exceptions.py
# class ModelConstraintException (TMAPIRuntimeException):
# 
#     """This exception is used to report Topic Maps - Data Model
#     constraint violations."""
# 
#     def __init__ (self, reporter, message):
#         """Creates a new ModelConstraintException with the specified
#         message.
# 
#         :param reporter: the construct which has thrown this exception
#         :type reporter: `Construct`
#         :param message: the detail message
#         :type message: string
# 
#         """
#         self._reporter = reporter
#         self._message = message
#     
#     def get_reporter (self):
#         """Return the `Construct` which has thrown the exception.
# 
#         :rtype: `Construct`
# 
#         """
#         return self._reporter


# Path: tmapi/models/reifiable.py
from django.db import models
from tmapi.exceptions import ModelConstraintException
from construct import Construct


    class Meta:
        abstract = True
        app_label = 'tmapi'

    def get_reifier (self):
        """Returns the reifier of this construct.

        :rtype: `Topic`

        """
        return self.reifier

    def set_reifier (self, reifier):
        """Sets the reifier of this consutrct.

        The specified reifier **must not** reify another information
        item.

        :param reifier: the topic that should reify this construct or
          None if an existing reifier should be removed
        :type reifier: `Topic` or None
        :raises `ModelConstraintException`: if the specified `reifier`
          reifies another construct

        """
        if reifier is None:
            reified = None
        else:
            if self.get_topic_map() != reifier.topic_map:

                raise ModelConstraintException(