diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-10-29 20:06:11 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-10-29 20:12:36 +0100 |
commit | 07eff011922affd5733814c13236fe149cd64fd1 (patch) | |
tree | a642e391b82ec397e6648e1512281e6171271fe5 /chimere/models.py | |
parent | fda62e9b16ff53c20880bd2ebbe34ce55d633c2d (diff) | |
download | Chimère-07eff011922affd5733814c13236fe149cd64fd1.tar.bz2 Chimère-07eff011922affd5733814c13236fe149cd64fd1.zip |
Importer HTML-XSLT: model - admin
* new fields for Importer model: alt source file (2 XSLT files can be used),
default location (these pages doesn't provide adresses)
* adapt admin to manage 2 type of hidden OpenLayers maps on the same page
Diffstat (limited to 'chimere/models.py')
-rw-r--r-- | chimere/models.py | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chimere/models.py b/chimere/models.py index 2c90d67..952594c 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -41,11 +41,12 @@ from django.db.models.signals import post_save, pre_save, m2m_changed from django.template import defaultfilters from django.utils.translation import ugettext_lazy as _ -from chimere.widgets import PointField, RouteField, SelectMultipleField, \ - TextareaWidget, DatePickerWidget +from chimere.widgets import HiddenPointChooserWidget, PointField, RouteField, \ + SelectMultipleField, TextareaWidget, \ + DatePickerWidget from chimere.managers import BaseGeoManager from chimere.utils import KMLManager, OSMManager, ShapefileManager, \ - GeoRSSManager, CSVManager + GeoRSSManager, CSVManager, HtmlXsltManager class Page(models.Model): """Simple extra pages @@ -302,14 +303,16 @@ IMPORTERS = {'KML':KMLManager, 'OSM':OSMManager, 'SHP':ShapefileManager, 'RSS':GeoRSSManager, - 'CSV':CSVManager + 'CSV':CSVManager, + 'XSLT':HtmlXsltManager } IMPORTER_CHOICES = (('KML', 'KML'), ('OSM', 'OSM'), ('SHP', 'Shapefile'), ('RSS', 'GeoRSS'), - ('CSV', 'CSV') + ('CSV', 'CSV'), + ('XSLT', 'HTML-XSLT') ) IMPORTER_CHOICES_DICT = dict(IMPORTER_CHOICES) @@ -326,6 +329,8 @@ class Importer(models.Model): blank=True, null=True) source_file = models.FileField(_(u"Source file"), upload_to='import_files', blank=True, null=True) + source_file_alt = models.FileField(_(u"Alt source file"), + upload_to='import_files', blank=True, null=True) default_name = models.CharField(_(u"Name by default"), max_length=200, blank=True, null=True) srid = models.IntegerField(_(u"SRID"), blank=True, null=True) @@ -346,6 +351,9 @@ class Importer(models.Model): blank=True, null=True) associate_marker_to_way = models.BooleanField(_(u"Automatically associate "\ u"a marker to a way"), default=False) + default_localisation = PointField(_(u"Default localisation"), + srid=settings.CHIMERE_EPSG_DISPLAY_PROJECTION, + blank=True, null=True, widget=HiddenPointChooserWidget) class Meta: verbose_name = _(u"Importer") |