summaryrefslogtreecommitdiff
path: root/chimere/admin.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-02-11 18:02:42 +0100
committerÉtienne Loks <etienne.loks@proxience.com>2015-02-11 18:02:42 +0100
commitec824db12597389c87184497796e8d0763c80b51 (patch)
treefb53154ba33dc4e31fe9bb25677e14d1c8418701 /chimere/admin.py
parentc70c2c8f4f58436df8d1c694a74c457954bd1070 (diff)
downloadChimère-ec824db12597389c87184497796e8d0763c80b51.tar.bz2
Chimère-ec824db12597389c87184497796e8d0763c80b51.zip
New importer type XML - XSLT. Importer: add relation between category key and categories
* new importer type XML - XSLT * associated form and UI modification * add new model ImporterKeyCategories * associated migration * associated admin modification * longer state field for Importers * associated migration
Diffstat (limited to 'chimere/admin.py')
-rw-r--r--chimere/admin.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/chimere/admin.py b/chimere/admin.py
index c9107a5..8d17a3c 100644
--- a/chimere/admin.py
+++ b/chimere/admin.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2008-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2008-2015 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as
@@ -43,7 +43,7 @@ from chimere.models import Category, Icon, SubCategory, Marker, \
PropertyModel, News, Route, Area, ColorTheme, Color, \
MultimediaFile, PictureFile, Importer, Layer, AreaLayers,\
PropertyModelChoice, MultimediaExtension, Page,\
- get_areas_for_user, get_users_by_area
+ get_areas_for_user, get_users_by_area, ImporterKeyCategories
from chimere.utils import unicode_normalize, ShapefileManager, KMLManager,\
CSVManager
@@ -383,13 +383,18 @@ def export_to_osm(modeladmin, request, queryset):
context_instance=RequestContext(request))
export_to_osm.short_description = _(u"Export to osm")
+class ImporterKeyInline(admin.TabularInline):
+ model = ImporterKeyCategories
+ extra = 1
+
class ImporterAdmin(admin.ModelAdmin):
form = ImporterAdminForm
- list_display = ('display_categories', 'default_name', 'importer_type',
+ list_display = ('importer_type', 'display_categories', 'default_name',
'source', 'state', 'filtr')
list_filter = ('importer_type', 'categories')
readonly_fields = ('state',)
actions = [importing, cancel_import, export_to_osm, cancel_export]
+ inlines = [ImporterKeyInline]
admin.site.register(Importer, ImporterAdmin)
class PageAdmin(admin.ModelAdmin):