mirror of
https://github.com/Hopiu/django-fobi.git
synced 2026-05-23 19:55:49 +00:00
wipe lt 1.8
This commit is contained in:
parent
3613971d87
commit
97747e3de9
16 changed files with 44 additions and 246 deletions
|
|
@ -2,10 +2,7 @@ from __future__ import absolute_import, unicode_literals
|
|||
import os
|
||||
from nine.versions import (
|
||||
DJANGO_GTE_1_10,
|
||||
DJANGO_GTE_1_7,
|
||||
DJANGO_GTE_1_8,
|
||||
DJANGO_GTE_1_9,
|
||||
DJANGO_LTE_1_7,
|
||||
)
|
||||
|
||||
# Full filesystem path to the project.
|
||||
|
|
@ -94,11 +91,6 @@ gettext = lambda s: s
|
|||
#
|
||||
# BLOG_USE_FEATURED_IMAGE = True
|
||||
|
||||
# If True, the south application will be automatically added to the
|
||||
# INSTALLED_APPS setting.
|
||||
USE_SOUTH = True
|
||||
|
||||
|
||||
########################
|
||||
# MAIN DJANGO SETTINGS #
|
||||
########################
|
||||
|
|
@ -197,7 +189,7 @@ if DJANGO_GTE_1_10:
|
|||
}
|
||||
},
|
||||
]
|
||||
elif DJANGO_GTE_1_8:
|
||||
else: # >= Django 1.8
|
||||
TEMPLATES = [
|
||||
{
|
||||
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
||||
|
|
@ -230,40 +222,6 @@ elif DJANGO_GTE_1_8:
|
|||
}
|
||||
},
|
||||
]
|
||||
else:
|
||||
TEMPLATE_DEBUG = DEBUG_TEMPLATE
|
||||
|
||||
# List of callables that know how to import templates from various
|
||||
# sources.
|
||||
TEMPLATE_LOADERS = [
|
||||
"django.template.loaders.filesystem.Loader",
|
||||
"django.template.loaders.app_directories.Loader",
|
||||
'django.template.loaders.eggs.Loader',
|
||||
|
||||
]
|
||||
if DJANGO_GTE_1_7:
|
||||
TEMPLATE_LOADERS.append('admin_tools.template_loaders.Loader')
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
"django.core.context_processors.debug",
|
||||
"django.core.context_processors.i18n",
|
||||
"django.core.context_processors.media",
|
||||
"django.core.context_processors.static",
|
||||
"django.core.context_processors.tz",
|
||||
"django.contrib.messages.context_processors.messages",
|
||||
"django.core.context_processors.request",
|
||||
"fobi.context_processors.theme", # Important!
|
||||
"fobi.context_processors.dynamic_values", # Optional
|
||||
# "context_processors.testing", # Testing
|
||||
|
||||
"mezzanine.conf.context_processors.settings",
|
||||
"mezzanine.pages.context_processors.page",
|
||||
)
|
||||
|
||||
TEMPLATE_DIRS = (
|
||||
os.path.join(PROJECT_ROOT, "templates"),
|
||||
)
|
||||
|
||||
########################################################
|
||||
|
||||
|
|
@ -488,10 +446,6 @@ MIDDLEWARE_CLASSES = (
|
|||
"mezzanine.core.middleware.FetchFromCacheMiddleware",
|
||||
)
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.south_migrations',
|
||||
}
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,11 +133,6 @@ USE_TZ = True
|
|||
|
||||
STATIC_URL = '/static/'
|
||||
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.south_migrations',
|
||||
}
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,10 +200,9 @@ else:
|
|||
'django.template.loaders.filesystem.Loader',
|
||||
'django.template.loaders.app_directories.Loader',
|
||||
'django.template.loaders.eggs.Loader',
|
||||
'admin_tools.template_loaders.Loader'
|
||||
|
||||
]
|
||||
if DJANGO_GTE_1_8:
|
||||
TEMPLATE_LOADERS.append('admin_tools.template_loaders.Loader')
|
||||
|
||||
TEMPLATE_CONTEXT_PROCESSORS = (
|
||||
"django.contrib.auth.context_processors.auth",
|
||||
|
|
@ -497,7 +496,6 @@ CKEDITOR_CONFIGS = {
|
|||
# LOGIN_URL = '/accounts/login/'
|
||||
# LOGIN_REDIRECT_URL = '/fobi/' # Important for passing the selenium tests
|
||||
|
||||
# if DJANGO_GTE_1_8:
|
||||
LOGIN_URL = '/en/accounts/login/'
|
||||
LOGIN_REDIRECT_URL = '/en/fobi/' # Important for passing the selenium tests
|
||||
|
||||
|
|
@ -512,7 +510,6 @@ PACKAGE_NAME_GRAPPELLI = "grappelli_safe" # Just for tests
|
|||
# 'fobi': 'migrations',
|
||||
# 'db_store': 'fobi.contrib.plugins.form_handlers.db_store.migrations'
|
||||
# }
|
||||
# SOUTH_MIGRATION_MODULES = 'south_migrations'
|
||||
|
||||
# **************************************************************
|
||||
# ********************* Registration settings ******************
|
||||
|
|
@ -632,11 +629,6 @@ ADMIN_TOOLS_APP_INDEX_DASHBOARD = \
|
|||
'admin_tools_dashboard.CustomAppIndexDashboard'
|
||||
ADMIN_TOOLS_MENU = 'admin_tools_dashboard.menu.CustomMenu'
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.south_migrations',
|
||||
'db_store': 'ignore',
|
||||
}
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
'db_store': 'fobi.contrib.plugins.form_handlers.db_store.migrations',
|
||||
|
|
@ -732,20 +724,18 @@ LOGGING = {
|
|||
}
|
||||
|
||||
# Make settings quite compatible among various Django versions used.
|
||||
if DJANGO_GTE_1_8:
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
||||
# Django 1.8 specific checks
|
||||
if DJANGO_GTE_1_8:
|
||||
try:
|
||||
INSTALLED_APPS.remove('admin_tools') \
|
||||
if 'admin_tools' in INSTALLED_APPS else None
|
||||
INSTALLED_APPS.remove('admin_tools.menu') \
|
||||
if 'admin_tools.menu' in INSTALLED_APPS else None
|
||||
INSTALLED_APPS.remove('admin_tools.dashboard') \
|
||||
if 'admin_tools.dashboard' in INSTALLED_APPS else None
|
||||
except Exception as e:
|
||||
pass
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
||||
try:
|
||||
INSTALLED_APPS.remove('admin_tools') \
|
||||
if 'admin_tools' in INSTALLED_APPS else None
|
||||
INSTALLED_APPS.remove('admin_tools.menu') \
|
||||
if 'admin_tools.menu' in INSTALLED_APPS else None
|
||||
INSTALLED_APPS.remove('admin_tools.dashboard') \
|
||||
if 'admin_tools.dashboard' in INSTALLED_APPS else None
|
||||
except Exception as e:
|
||||
pass
|
||||
|
||||
# For Selenium tests
|
||||
FIREFOX_BIN_PATH = ''
|
||||
|
|
|
|||
|
|
@ -18,11 +18,6 @@ INSTALLED_APPS += [
|
|||
]
|
||||
|
||||
try:
|
||||
INSTALLED_APPS.remove('south') if 'south' in INSTALLED_APPS else None
|
||||
# INSTALLED_APPS.remove('admin_tools') \
|
||||
# if 'admin_tools' in INSTALLED_APPS else None
|
||||
# INSTALLED_APPS.remove('admin_tools.menu') \
|
||||
# if 'admin_tools.menu' in INSTALLED_APPS else None
|
||||
INSTALLED_APPS.remove('admin_tools.dashboard') \
|
||||
if 'admin_tools.dashboard' in INSTALLED_APPS else None
|
||||
except Exception as err:
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from cms import __version__
|
||||
from nine.versions import DJANGO_GTE_1_8
|
||||
from .base import *
|
||||
|
||||
CMS_VERSION = [int(__v) for __v in __version__.split('.')]
|
||||
|
|
@ -70,12 +69,9 @@ MIDDLEWARE_CLASSES += [
|
|||
# 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
]
|
||||
|
||||
if DJANGO_GTE_1_8:
|
||||
TEMPLATES[0]['OPTIONS']['context_processors'] += \
|
||||
DJANGO_CMS_CONTEXT_PROCESSORS
|
||||
else:
|
||||
TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS)
|
||||
TEMPLATE_CONTEXT_PROCESSORS += DJANGO_CMS_CONTEXT_PROCESSORS
|
||||
|
||||
TEMPLATES[0]['OPTIONS']['context_processors'] += \
|
||||
DJANGO_CMS_CONTEXT_PROCESSORS
|
||||
|
||||
FOBI_DEFAULT_THEME = 'bootstrap3'
|
||||
# FOBI_DEFAULT_THEME = 'foundation5'
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
from nine.versions import DJANGO_GTE_1_8
|
||||
from .base import *
|
||||
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
|
@ -22,9 +21,7 @@ FEINCMS_RICHTEXT_INIT_CONTEXT = {
|
|||
'TINYMCE_JS_URL': STATIC_URL + 'tiny_mce/tiny_mce.js',
|
||||
}
|
||||
|
||||
if DJANGO_GTE_1_8:
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
'db_store': 'fobi.contrib.plugins.form_handlers.db_store.migrations',
|
||||
}
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
'db_store': 'fobi.contrib.plugins.form_handlers.db_store.migrations',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,19 +44,12 @@ MIDDLEWARE_CLASSES += [
|
|||
# 'django.middleware.cache.FetchFromCacheMiddleware',
|
||||
]
|
||||
|
||||
if DJANGO_GTE_1_8:
|
||||
TEMPLATES[0]['OPTIONS']['context_processors'] += [
|
||||
'cms.context_processors.cms_settings',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'cms.context_processors.cms_settings',
|
||||
]
|
||||
else:
|
||||
TEMPLATE_CONTEXT_PROCESSORS = list(TEMPLATE_CONTEXT_PROCESSORS)
|
||||
TEMPLATE_CONTEXT_PROCESSORS += [
|
||||
'cms.context_processors.cms_settings',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'cms.context_processors.cms_settings',
|
||||
]
|
||||
|
||||
TEMPLATES[0]['OPTIONS']['context_processors'] += [
|
||||
'cms.context_processors.cms_settings',
|
||||
'sekizai.context_processors.sekizai',
|
||||
'cms.context_processors.cms_settings',
|
||||
]
|
||||
|
||||
# FOBI_DEFAULT_THEME = 'bootstrap3'
|
||||
# FOBI_DEFAULT_THEME = 'foundation5'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from nine.versions import DJANGO_GTE_1_7
|
||||
|
||||
from .base import *
|
||||
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
|
@ -8,9 +6,3 @@ try:
|
|||
INSTALLED_APPS.append('override_radio_plugin')
|
||||
except Exception as err:
|
||||
pass
|
||||
|
||||
if DJANGO_GTE_1_7:
|
||||
try:
|
||||
INSTALLED_APPS.remove('south') if 'south' in INSTALLED_APPS else None
|
||||
except Exception as err:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from nine.versions import DJANGO_GTE_1_7
|
||||
|
||||
from .base import *
|
||||
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
|
@ -8,9 +6,3 @@ try:
|
|||
INSTALLED_APPS.append('override_select_model_object_plugin')
|
||||
except Exception as err:
|
||||
pass
|
||||
|
||||
if DJANGO_GTE_1_7:
|
||||
try:
|
||||
INSTALLED_APPS.remove('south') if 'south' in INSTALLED_APPS else None
|
||||
except Exception as err:
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
from nine.versions import DJANGO_GTE_1_7
|
||||
|
||||
from .base import *
|
||||
|
||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||
|
|
@ -10,12 +8,6 @@ try:
|
|||
except Exception as err:
|
||||
pass
|
||||
|
||||
if DJANGO_GTE_1_7:
|
||||
try:
|
||||
INSTALLED_APPS.remove('south') if 'south' in INSTALLED_APPS else None
|
||||
except Exception as err:
|
||||
pass
|
||||
|
||||
FOBI_DEFAULT_THEME = 'simple'
|
||||
|
||||
CRISPY_TEMPLATE_PACK = 'uni_form'
|
||||
|
|
|
|||
|
|
@ -75,10 +75,7 @@ url_patterns_args += [
|
|||
# url(r'^', include('fobi.contrib.apps.public_forms.urls')),
|
||||
]
|
||||
|
||||
if versions.DJANGO_LTE_1_7:
|
||||
urlpatterns += i18n_patterns('', *url_patterns_args)
|
||||
else:
|
||||
urlpatterns += i18n_patterns(*url_patterns_args)
|
||||
urlpatterns += i18n_patterns(*url_patterns_args)
|
||||
|
||||
# Serving media and static in debug/developer mode.
|
||||
if settings.DEBUG:
|
||||
|
|
|
|||
|
|
@ -138,10 +138,6 @@ TEMPLATE_DIRS = (
|
|||
PROJECT_DIR('templates'),
|
||||
)
|
||||
|
||||
#FIXTURE_DIRS = (
|
||||
# PROJECT_DIR(os.path.join('..', 'fixtures'))
|
||||
#)
|
||||
|
||||
INSTALLED_APPS = (
|
||||
# Admin dashboard
|
||||
#'admin_tools',
|
||||
|
|
@ -159,11 +155,9 @@ INSTALLED_APPS = (
|
|||
'django.contrib.sitemaps',
|
||||
|
||||
# Third party apps used in the project
|
||||
'south', # Database migration app
|
||||
'tinymce', # TinyMCE
|
||||
'easy_thumbnails', # Thumbnailer
|
||||
'registration', # Auth views and registration app
|
||||
#'localeurl', # Locale URL
|
||||
'tinymce', # TinyMCE
|
||||
'easy_thumbnails', # Thumbnailer
|
||||
'registration', # Auth views and registration app
|
||||
|
||||
# Fobi core
|
||||
'fobi',
|
||||
|
|
@ -198,12 +192,12 @@ INSTALLED_APPS = (
|
|||
#'fobi.contrib.plugins.form_handlers.mail',
|
||||
|
||||
# Your custom fobi apps
|
||||
'sample_layout', # Sample theme/layout
|
||||
'sample_textarea', # Sample text area form element plugin
|
||||
'sample_mail', # Sample mail form handler plugin
|
||||
'sample_layout', # Sample theme/layout
|
||||
'sample_textarea', # Sample text area form element plugin
|
||||
'sample_mail', # Sample mail form handler plugin
|
||||
|
||||
# Other project specific apps
|
||||
'foo', # Test app
|
||||
'foo', # Test app
|
||||
)
|
||||
|
||||
LOGIN_REDIRECT_URL = '/fobi/' # Important for passing the selenium tests
|
||||
|
|
@ -212,25 +206,11 @@ LOGIN_REDIRECT_URL = '/fobi/' # Important for passing the selenium tests
|
|||
#LOGIN_ERROR_URL = '/accounts/login/'
|
||||
#LOGOUT_URL = '/accounts/logout/'
|
||||
|
||||
# localeurl locale independent paths (language code won't be appended)
|
||||
LOCALE_INDEPENDENT_PATHS = (
|
||||
r'^/sitemap.*\.xml$', # Global regex for all XML sitemaps
|
||||
#r'^/admin/',
|
||||
#r'^/dashboard/',
|
||||
)
|
||||
|
||||
# Tell localeurl to use sessions for language store.
|
||||
LOCALEURL_USE_SESSION = True
|
||||
|
||||
# django-admin-tools custom dashboard
|
||||
ADMIN_TOOLS_INDEX_DASHBOARD = 'admin_tools_dashboard.CustomIndexDashboard'
|
||||
ADMIN_TOOLS_APP_INDEX_DASHBOARD = 'admin_tools_dashboard.CustomAppIndexDashboard'
|
||||
ADMIN_TOOLS_MENU = 'admin_tools_dashboard.menu.CustomMenu'
|
||||
|
||||
SOUTH_MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.south_migrations',
|
||||
}
|
||||
|
||||
MIGRATION_MODULES = {
|
||||
'fobi': 'fobi.migrations',
|
||||
}
|
||||
|
|
@ -308,7 +288,7 @@ if DEBUG and DEBUG_TOOLBAR:
|
|||
# debug_toolbar
|
||||
MIDDLEWARE_CLASSES += (
|
||||
'debug_toolbar.middleware.DebugToolbarMiddleware',
|
||||
)
|
||||
)
|
||||
|
||||
INSTALLED_APPS += (
|
||||
'debug_toolbar',
|
||||
|
|
|
|||
31
setup.py
31
setup.py
|
|
@ -233,23 +233,10 @@ install_requires = []
|
|||
# If certain version of Django is already installed, choose version agnostic
|
||||
# dependencies.
|
||||
if DJANGO_INSTALLED:
|
||||
if DJANGO_1_5 or DJANGO_1_6 or DJANGO_1_7:
|
||||
if DJANGO_1_8:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
'Pillow>=2.0.0',
|
||||
'requests>=1.0.0',
|
||||
'six>=1.9',
|
||||
'Unidecode>=0.04.1',
|
||||
'vishap>=0.1.5,<2.0',
|
||||
]
|
||||
|
||||
elif DJANGO_1_8:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug==1.9.4',
|
||||
'django-formtools>=1.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
|
|
@ -262,7 +249,7 @@ if DJANGO_INSTALLED:
|
|||
elif DJANGO_1_9:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug==1.9.4',
|
||||
'django-formtools>=1.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
|
|
@ -275,7 +262,7 @@ if DJANGO_INSTALLED:
|
|||
elif DJANGO_1_10:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug==1.9.4',
|
||||
'django-formtools>=1.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
|
|
@ -288,7 +275,7 @@ if DJANGO_INSTALLED:
|
|||
elif DJANGO_1_11:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug==1.9.4',
|
||||
'django-formtools>=2.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
|
|
@ -305,7 +292,7 @@ if DJANGO_INSTALLED:
|
|||
elif DJANGO_2_0:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug==1.9.4',
|
||||
'django-formtools>=2.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.3',
|
||||
|
|
@ -324,7 +311,7 @@ if DJANGO_INSTALLED:
|
|||
if not install_requires:
|
||||
install_requires = [
|
||||
'bleach',
|
||||
'django-autoslug-iplweb>=1.9.4',
|
||||
'django-autoslug>=1.9.4',
|
||||
'django-formtools>=2.0',
|
||||
'django-nine>=0.1.13',
|
||||
'django-nonefield>=0.1',
|
||||
|
|
@ -350,7 +337,7 @@ tests_require = [
|
|||
]
|
||||
|
||||
if PY3:
|
||||
install_requires.append('simplejson>=3.0.0') # When using Python 3
|
||||
install_requires.append('simplejson>=3.0.0,<=3.8.0') # When using Python3
|
||||
if DJANGO_INSTALLED and not DJANGO_1_11:
|
||||
install_requires.append('easy-thumbnails>=2.3')
|
||||
else:
|
||||
|
|
@ -361,7 +348,7 @@ if PY3:
|
|||
# '#egg=easy-thumbnails'
|
||||
# )
|
||||
else:
|
||||
install_requires.append('simplejson>=2.1.0') # When using Python 2.*
|
||||
install_requires.append('simplejson>=2.1.0,<=3.8.0') # When using Python2
|
||||
install_requires.append('ordereddict>=1.1')
|
||||
if DJANGO_INSTALLED and not DJANGO_1_11:
|
||||
install_requires.append('easy-thumbnails>=1.4')
|
||||
|
|
|
|||
|
|
@ -43,11 +43,6 @@ class DataExporter(object):
|
|||
For compatibility with older versions (`mimetype` vs `content_type`).
|
||||
"""
|
||||
response_kwargs = {'content_type': mimetype}
|
||||
# response_kwargs = {}
|
||||
# if DJANGO_GTE_1_7:
|
||||
# response_kwargs['content_type'] = mimetype
|
||||
# else:
|
||||
# response_kwargs['mimetype'] = mimetype
|
||||
return HttpResponse(**response_kwargs)
|
||||
|
||||
def _get_data_headers(self):
|
||||
|
|
|
|||
|
|
@ -5,40 +5,10 @@ import sys
|
|||
# from django.conf import settings
|
||||
from django.utils.module_loading import autodiscover_modules
|
||||
|
||||
# from nine.versions import DJANGO_GTE_1_7
|
||||
|
||||
import six
|
||||
|
||||
from .conf import get_setting
|
||||
|
||||
# In Django a dotted path can be used up to the app config class. In
|
||||
# such cases the old-school auto-discovery of modules doesn't work but we
|
||||
# have a great Django `autodiscover_modules` tool then. In cases if Django
|
||||
# version is >= 1.7, we use the Django `autodiscover_modules` tool falling back
|
||||
# to our own implementation of it otherwise.
|
||||
# if DJANGO_GTE_1_7:
|
||||
# from django.utils.module_loading import autodiscover_modules
|
||||
# else:
|
||||
# def autodiscover_modules(module_name):
|
||||
# """Auto-discover modules."""
|
||||
# for app in settings.INSTALLED_APPS:
|
||||
# try:
|
||||
# app = str(app)
|
||||
# app_path = __import__(
|
||||
# app, {}, {}, [app.split('.')[-1]]
|
||||
# ).__path__
|
||||
# except (AttributeError, TypeError) as err:
|
||||
# logger.debug(str(err))
|
||||
# continue
|
||||
#
|
||||
# try:
|
||||
# imp.find_module(module_name, app_path)
|
||||
# except ImportError as err:
|
||||
# logger.debug(str(err))
|
||||
# continue
|
||||
# __import__('{0}.{1}'.format(app, module_name))
|
||||
|
||||
|
||||
logger = logging.getLogger(__file__)
|
||||
|
||||
__title__ = 'fobi.discover'
|
||||
|
|
|
|||
|
|
@ -348,12 +348,6 @@ def get_registered_models(ignore=[]):
|
|||
:return list:
|
||||
"""
|
||||
get_models = django.apps.apps.get_models
|
||||
# if DJANGO_GTE_1_7:
|
||||
# get_models = django.apps.apps.get_models
|
||||
# else:
|
||||
# def get_models():
|
||||
# """Get models."""
|
||||
# return models.get_models(include_auto_created=True)
|
||||
|
||||
registered_models = [
|
||||
(
|
||||
|
|
@ -364,22 +358,6 @@ def get_registered_models(ignore=[]):
|
|||
in get_models()
|
||||
]
|
||||
|
||||
# registered_models = []
|
||||
# try:
|
||||
# content_types = ContentType._default_manager.all()
|
||||
#
|
||||
# for content_type in content_types:
|
||||
# # model = content_type.model_class()
|
||||
# content_type_id = "{0}.{1}".format(
|
||||
# content_type.app_label, content_type.model
|
||||
# )
|
||||
# if content_type_id not in ignore:
|
||||
# registered_models.append(
|
||||
# (content_type_id, content_type.name)
|
||||
# )
|
||||
# except DatabaseError as err:
|
||||
# logger.debug(str(err))
|
||||
|
||||
return registered_models
|
||||
|
||||
|
||||
|
|
@ -753,11 +731,6 @@ class JSONDataExporter(object):
|
|||
:return django.http.HttpResponse:
|
||||
"""
|
||||
response_kwargs = {'content_type': mimetype}
|
||||
# response_kwargs = {}
|
||||
# if DJANGO_GTE_1_7:
|
||||
# response_kwargs['content_type'] = mimetype
|
||||
# else:
|
||||
# response_kwargs['mimetype'] = mimetype
|
||||
return HttpResponse(**response_kwargs)
|
||||
|
||||
def export_to_json(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue