diff options
| -rw-r--r-- | chimere/admin.py | 10 | ||||
| -rw-r--r-- | chimere_example_project/settings.py | 34 | 
2 files changed, 38 insertions, 6 deletions
diff --git a/chimere/admin.py b/chimere/admin.py index a30f0df..acc9cfc 100644 --- a/chimere/admin.py +++ b/chimere/admin.py @@ -187,20 +187,22 @@ admin.site.unregister(User)  admin.site.register(User, UserAdmin) -class PictureInline(admin.TabularInline): +class PictureMarkerInline(admin.TabularInline):      model = PictureFile      extra = 1      ordering = ('order',)      form = PictureFileAdminForm      readonly_fields = ('height', 'width') -    exclude = ('thumbnailfile', 'thumbnailfile_height', 'thumbnailfile_width') +    exclude = ('thumbnailfile', 'thumbnailfile_height', 'thumbnailfile_width', +               'polygon') -class MultimediaInline(admin.TabularInline): +class MultimediaMarkerInline(admin.TabularInline):      model = MultimediaFile      extra = 1      ordering = ('order',)      form = MultimediaFileAdminForm +    exclude = ('polygon', )  class AreaMarkerListFilter(admin.SimpleListFilter): @@ -339,7 +341,7 @@ class MarkerAdmin(admin.ModelAdmin):          'submiter_name', 'ref_item', 'modified_since_import', 'route']      form = MarkerAdminForm      fieldsets = MARKER_FIELDSETS -    inlines = [MultimediaInline, PictureInline] +    inlines = [MultimediaMarkerInline, PictureMarkerInline]      has_properties = True      def get_fieldsets(self, request, obj=None): diff --git a/chimere_example_project/settings.py b/chimere_example_project/settings.py index 187d4ba..8ab1da4 100644 --- a/chimere_example_project/settings.py +++ b/chimere_example_project/settings.py @@ -11,6 +11,9 @@ _ = lambda s: s  DEBUG = False  TEMPLATE_DEBUG = DEBUG  MOBILE_TEST = False +DEBUG_TOOLBAR = False +SQL_DEBUG = False +  # Django settings for chimere project.  PROJECT_NAME = 'Chimere' @@ -212,13 +215,13 @@ TEMPLATE_LOADERS = (      'django.template.loaders.app_directories.Loader',  ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE_CLASSES = [      'django.middleware.common.CommonMiddleware',      'django.contrib.sessions.middleware.SessionMiddleware',      'django.contrib.auth.middleware.AuthenticationMiddleware',      'django.middleware.doc.XViewMiddleware',      'django.contrib.messages.middleware.MessageMiddleware' -) +]  ROOT_URLCONF = 'chimere_example_project.urls' @@ -350,3 +353,30 @@ if 'OSM_MOBILE_JS_URLS' not in globals():          STATIC_URL + "openlayers/OpenLayers.mobile.js",          STATIC_URL + "openlayers/SimplePanZoom.js",          "http://www.openstreetmap.org/openlayers/OpenStreetMap.js"] + +if DEBUG_TOOLBAR: +    if '..' not in sys.path: +        sys.path.insert(0, '..') +    global DEBUG_TOOLBAR_PANELS +    global DEBUG_TOOLBAR_CONFIG +    MIDDLEWARE_CLASSES += ['debug_toolbar.middleware.DebugToolbarMiddleware'] +    INSTALLED_APPS += ['debug_toolbar'] +    DEBUG_TOOLBAR_PANELS = ( +        'debug_toolbar.panels.version.VersionDebugPanel', +        'debug_toolbar.panels.timer.TimerDebugPanel', +        'debug_toolbar.panels.settings_vars.SettingsVarsDebugPanel', +        'debug_toolbar.panels.headers.HeaderDebugPanel', +        'debug_toolbar.panels.request_vars.RequestVarsDebugPanel', +        'debug_toolbar.panels.template.TemplateDebugPanel', +        'debug_toolbar.panels.sql.SQLDebugPanel', +        'debug_toolbar.panels.signals.SignalDebugPanel', +        'debug_toolbar.panels.logger.LoggingPanel', +    ) +    DEBUG_TOOLBAR_CONFIG = {'INTERCEPT_REDIRECTS': False} + + +if SQL_DEBUG: +    LOGGING['loggers']['django.db.backends'] = { +        'level': 'DEBUG', +        'handlers': ['console'], +    }  | 
