# Path: basic_cms/settings.py
# def get_setting(*args, **kwargs):
# def get_page_templates():
# TEMPLATES = get_setting('TEMPLATES', raise_error=True)
# PAGE_DEFAULT_TEMPLATE = get_setting('PAGE_DEFAULT_TEMPLATE',
#     'DEFAULT_PAGE_TEMPLATE', raise_error=True)
# PAGE_TEMPLATES = get_setting('PAGE_TEMPLATES',
#     default_value=())
# PAGE_TINYMCE = getattr(settings, 'PAGE_TINYMCE', False)
# PAGE_UNIQUE_SLUG_REQUIRED = getattr(settings, 'PAGE_UNIQUE_SLUG_REQUIRED',
#                                     True)
# PAGE_CONTENT_REVISION = getattr(settings, 'PAGE_CONTENT_REVISION', True)
# PAGE_CONTENT_REVISION_DEPTH = getattr(settings,
#     'PAGE_CONTENT_REVISION_DEPTH', 10)
# PAGE_LANGUAGES = get_setting('PAGE_LANGUAGES', raise_error=True)
# PAGE_DEFAULT_LANGUAGE = get_setting('PAGE_DEFAULT_LANGUAGE',
#     'LANGUAGE_CODE', raise_error=True)
# PAGE_EXTRA_PERMISSIONS = getattr(settings, 'PAGE_EXTRA_PERMISSIONS', extra)
# PAGE_LANGUAGE_MAPPING = getattr(settings, 'PAGE_LANGUAGE_MAPPING', lambda l: l)
# SITE_ID = getattr(settings, 'SITE_ID', 1)
# PAGE_USE_SITE_ID = getattr(settings, 'PAGE_USE_SITE_ID', False)
# PAGE_HIDE_SITES = getattr(settings, 'PAGE_HIDE_SITES', False)
# PAGE_USE_LANGUAGE_PREFIX = getattr(settings, 'PAGE_USE_LANGUAGE_PREFIX',
#                                                                         False)
# PAGE_USE_STRICT_URL = getattr(settings, 'PAGE_USE_STRICT_URL', False)
# PAGE_CONTENT_REVISION_EXCLUDE_LIST = getattr(settings,
#     'PAGE_CONTENT_REVISION_EXCLUDE_LIST', ()
# )
# PAGE_SANITIZE_USER_INPUT = getattr(settings, 'PAGE_SANITIZE_USER_INPUT', False)
# PAGES_MEDIA_URL = get_setting('PAGES_MEDIA_URL')
#     PAGES_MEDIA_URL = str(media_url) + 'pages/'
# PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_HIDE_ROOT_SLUG', False)
# PAGE_SHOW_START_DATE = getattr(settings, 'PAGE_SHOW_START_DATE', False)
# PAGE_SHOW_END_DATE = getattr(settings, 'PAGE_SHOW_END_DATE', False)
# PAGE_CONNECTED_MODELS = getattr(settings, 'PAGE_CONNECTED_MODELS', False)
# PAGE_LINK_FILTER = getattr(settings, 'PAGE_LINK_FILTER', False)
# PAGE_EXTRA_CONTEXT = getattr(settings, 'PAGE_EXTRA_CONTEXT', None)
# PAGE_UPLOAD_ROOT = getattr(settings, 'PAGE_UPLOAD_ROOT', 'upload')
# PAGE_ENABLE_TESTS = getattr(settings, 'PAGE_ENABLE_TESTS', False)
# PAGE_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
# PAGE_AUTOMATIC_SLUG_RENAMING = getattr(settings, 'PAGE_AUTOMATIC_SLUG_RENAMING', False)
# INSTALLED_APPS = getattr(settings, 'INSTALLED_APPS',
#                          ())
# FILEBROWSER_DIRECTORY = False
#     FILEBROWSER_DIRECTORY = getattr(settings, 'FILEBROWSER_DIRECTORY',
#                                     getattr(filebrowser_settigns, 'DIRECTORY', False))
# PAGE_ADD_API = getattr(settings, 'PAGE_ADD_API', True)


from . import settings
from django.contrib import admin
from django.forms import ModelForm
from django.core.urlresolvers import get_mod_func
import django
# -*- coding: utf-8 -*-

# TODO: get rid of this
# What is wrong with https://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects
def get_connected():
    if not settings.PAGE_CONNECTED_MODELS:
        return []

    models = []

# Path: basic_cms/settings.py
# def get_setting(*args, **kwargs):
# def get_page_templates():
# TEMPLATES = get_setting('TEMPLATES', raise_error=True)
# PAGE_DEFAULT_TEMPLATE = get_setting('PAGE_DEFAULT_TEMPLATE',
#     'DEFAULT_PAGE_TEMPLATE', raise_error=True)
# PAGE_TEMPLATES = get_setting('PAGE_TEMPLATES',
#     default_value=())
# PAGE_TINYMCE = getattr(settings, 'PAGE_TINYMCE', False)
# PAGE_UNIQUE_SLUG_REQUIRED = getattr(settings, 'PAGE_UNIQUE_SLUG_REQUIRED',
#                                     True)
# PAGE_CONTENT_REVISION = getattr(settings, 'PAGE_CONTENT_REVISION', True)
# PAGE_CONTENT_REVISION_DEPTH = getattr(settings,
#     'PAGE_CONTENT_REVISION_DEPTH', 10)
# PAGE_LANGUAGES = get_setting('PAGE_LANGUAGES', raise_error=True)
# PAGE_DEFAULT_LANGUAGE = get_setting('PAGE_DEFAULT_LANGUAGE',
#     'LANGUAGE_CODE', raise_error=True)
# PAGE_EXTRA_PERMISSIONS = getattr(settings, 'PAGE_EXTRA_PERMISSIONS', extra)
# PAGE_LANGUAGE_MAPPING = getattr(settings, 'PAGE_LANGUAGE_MAPPING', lambda l: l)
# SITE_ID = getattr(settings, 'SITE_ID', 1)
# PAGE_USE_SITE_ID = getattr(settings, 'PAGE_USE_SITE_ID', False)
# PAGE_HIDE_SITES = getattr(settings, 'PAGE_HIDE_SITES', False)
# PAGE_USE_LANGUAGE_PREFIX = getattr(settings, 'PAGE_USE_LANGUAGE_PREFIX',
#                                                                         False)
# PAGE_USE_STRICT_URL = getattr(settings, 'PAGE_USE_STRICT_URL', False)
# PAGE_CONTENT_REVISION_EXCLUDE_LIST = getattr(settings,
#     'PAGE_CONTENT_REVISION_EXCLUDE_LIST', ()
# )
# PAGE_SANITIZE_USER_INPUT = getattr(settings, 'PAGE_SANITIZE_USER_INPUT', False)
# PAGES_MEDIA_URL = get_setting('PAGES_MEDIA_URL')
#     PAGES_MEDIA_URL = str(media_url) + 'pages/'
# PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_HIDE_ROOT_SLUG', False)
# PAGE_SHOW_START_DATE = getattr(settings, 'PAGE_SHOW_START_DATE', False)
# PAGE_SHOW_END_DATE = getattr(settings, 'PAGE_SHOW_END_DATE', False)
# PAGE_CONNECTED_MODELS = getattr(settings, 'PAGE_CONNECTED_MODELS', False)
# PAGE_LINK_FILTER = getattr(settings, 'PAGE_LINK_FILTER', False)
# PAGE_EXTRA_CONTEXT = getattr(settings, 'PAGE_EXTRA_CONTEXT', None)
# PAGE_UPLOAD_ROOT = getattr(settings, 'PAGE_UPLOAD_ROOT', 'upload')
# PAGE_ENABLE_TESTS = getattr(settings, 'PAGE_ENABLE_TESTS', False)
# PAGE_USER_MODEL = getattr(settings, 'AUTH_USER_MODEL', 'auth.User')
# PAGE_AUTOMATIC_SLUG_RENAMING = getattr(settings, 'PAGE_AUTOMATIC_SLUG_RENAMING', False)
# INSTALLED_APPS = getattr(settings, 'INSTALLED_APPS',
#                          ())
# FILEBROWSER_DIRECTORY = False
#     FILEBROWSER_DIRECTORY = getattr(settings, 'FILEBROWSER_DIRECTORY',
#                                     getattr(filebrowser_settigns, 'DIRECTORY', False))
# PAGE_ADD_API = getattr(settings, 'PAGE_ADD_API', True)


# Path: basic_cms/admin/utils.py
from . import settings
from django.contrib import admin
from django.forms import ModelForm
from django.core.urlresolvers import get_mod_func
import django

# -*- coding: utf-8 -*-

# TODO: get rid of this
# What is wrong with https://docs.djangoproject.com/en/dev/ref/contrib/admin/#inlinemodeladmin-objects
def get_connected():
    if not settings.PAGE_CONNECTED_MODELS:
        return []

    models = []

    for capp in settings.PAGE_CONNECTED_MODELS: