summaryrefslogtreecommitdiff
path: root/chimere/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'chimere/models.py')
-rw-r--r--chimere/models.py18
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")