# Path: dynamic_rest/utils.py
# def model_from_definition(model_definition):
#     """
#     Return a Django model corresponding to model_definition.
# 
#     Model definition can either be a string defining how to import the model,
#     or a model class.
# 
#     Arguments:
#         model_definition: (str|django.db.models.Model)
# 
#     Returns:
#         (django.db.models.Model)
# 
#     Implementation from
#     https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
#     """
#     if isinstance(model_definition, str):
#         model = import_string(model_definition)
#     else:
#         model = model_definition
# 
#     try:
#         assert issubclass(model, models.Model)
#     except (AssertionError, TypeError):
#         raise AssertionError(
#             '"{0}"" is not a Django model'.format(model_definition))
# 
#     return model


from dynamic_rest.utils import model_from_definition
        self.model = kwargs.pop('model', None)
        super(GetModelMixin, self).__init__(*args, **kwargs)

    def get_model(self):
        """
        Return the model to generate the HashId for.

        By default, this will equal the model defined within the Meta of the
        ModelSerializer, but can be redefined either during initialisation
        of the Field, or by providing a get_<field_name>_model method on the
        parent serializer.

        The Meta can either explicitly define a model, or provide a
        dot-delimited string path to it.
        """
        if self.model is None:
            custom_fn_name = 'get_{0}_model'.format(self.field_name)

            if hasattr(self.parent, custom_fn_name):
                return getattr(self.parent, custom_fn_name)()
            else:
                try:
                    return self.parent.Meta.model
                except AttributeError:
                    raise AssertionError(
                        'No "model" value passed to field "{0}"'.format(
                            type(self).__name__
                        )
                    )
        elif isinstance(self.model, str):

# Path: dynamic_rest/utils.py
# def model_from_definition(model_definition):
#     """
#     Return a Django model corresponding to model_definition.
# 
#     Model definition can either be a string defining how to import the model,
#     or a model class.
# 
#     Arguments:
#         model_definition: (str|django.db.models.Model)
# 
#     Returns:
#         (django.db.models.Model)
# 
#     Implementation from
#     https://github.com/evenicoulddoit/django-rest-framework-serializer-extensions
#     """
#     if isinstance(model_definition, str):
#         model = import_string(model_definition)
#     else:
#         model = model_definition
# 
#     try:
#         assert issubclass(model, models.Model)
#     except (AssertionError, TypeError):
#         raise AssertionError(
#             '"{0}"" is not a Django model'.format(model_definition))
# 
#     return model


# Path: dynamic_rest/bases.py
from dynamic_rest.utils import model_from_definition

        self.model = kwargs.pop('model', None)
        super(GetModelMixin, self).__init__(*args, **kwargs)

    def get_model(self):
        """
        Return the model to generate the HashId for.

        By default, this will equal the model defined within the Meta of the
        ModelSerializer, but can be redefined either during initialisation
        of the Field, or by providing a get_<field_name>_model method on the
        parent serializer.

        The Meta can either explicitly define a model, or provide a
        dot-delimited string path to it.
        """
        if self.model is None:
            custom_fn_name = 'get_{0}_model'.format(self.field_name)

            if hasattr(self.parent, custom_fn_name):
                return getattr(self.parent, custom_fn_name)()
            else:
                try:
                    return self.parent.Meta.model
                except AttributeError:
                    raise AssertionError(
                        'No "model" value passed to field "{0}"'.format(
                            type(self).__name__
                        )
                    )
        elif isinstance(self.model, str):

            return model_from_definition(self.model)