# Path: django_evolution/compat/datastructures.py

# 
# Path: django_evolution/compat/models.py
# def get_models(app_mod=None, include_auto_created=False):
# def set_model_name(model, name):
# def get_model_name(model):
# def get_rel_target_field(field):
# def get_remote_field(field):
# def get_remote_field_model(rel):


from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
    from django.apps.config import AppConfig
    from django.apps.registry import apps
    from django.db.models.loading import cache
from django_evolution.compat.datastructures import OrderedDict
from django_evolution.compat.models import all_models
    if apps:
        # Django >= 1.7
        #
        # We need to balance the ``set_installed_apps`` from
        # :py:func:`register_app` here.
        apps.unset_installed_apps()

    all_models[app_label].clear()
    clear_app_cache()


def register_app_models(app_label, model_infos, reset=False):
    """Register one or more models to a given app.

    These will add onto the list of existing models.

    Args:
        app_label (str):
            The label of the app to register the models on.

        model_info (list);
            A list of pairs of ``(model name, model class)`` to register.

        reset (bool, optional):
            If set, the old list will be overwritten with the new list.
    """
    if app_label not in all_models:
        # This isn't really needed for Django 1.7+ (which uses defaultdict
        # with OrderedDict), but it's needed for earlier versions, so do it
        # explicitly.

# Path: django_evolution/compat/datastructures.py

# 
# Path: django_evolution/compat/models.py
# def get_models(app_mod=None, include_auto_created=False):
# def set_model_name(model, name):
# def get_model_name(model):
# def get_rel_target_field(field):
# def get_remote_field(field):
# def get_remote_field_model(rel):


# Path: django_evolution/compat/apps.py
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
    from django.apps.config import AppConfig
    from django.apps.registry import apps
    from django.db.models.loading import cache
from django_evolution.compat.datastructures import OrderedDict
from django_evolution.compat.models import all_models

    if apps:
        # Django >= 1.7
        #
        # We need to balance the ``set_installed_apps`` from
        # :py:func:`register_app` here.
        apps.unset_installed_apps()

    all_models[app_label].clear()
    clear_app_cache()


def register_app_models(app_label, model_infos, reset=False):
    """Register one or more models to a given app.

    These will add onto the list of existing models.

    Args:
        app_label (str):
            The label of the app to register the models on.

        model_info (list);
            A list of pairs of ``(model name, model class)`` to register.

        reset (bool, optional):
            If set, the old list will be overwritten with the new list.
    """
    if app_label not in all_models:
        # This isn't really needed for Django 1.7+ (which uses defaultdict
        # with OrderedDict), but it's needed for earlier versions, so do it
        # explicitly.

        all_models[app_label] = OrderedDict()