diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-01-31 15:48:57 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2013-01-31 15:48:57 +0100 |
commit | fb64637f6579952516d2c4839fdd99df1e707ed4 (patch) | |
tree | 5884752fc4319dfdedef59c9fe0ffd5b792db8a9 | |
parent | 600e2114ff29f1d87663bda0b300774ec3f5575b (diff) | |
download | Chimère-fb64637f6579952516d2c4839fdd99df1e707ed4.tar.bz2 Chimère-fb64637f6579952516d2c4839fdd99df1e707ed4.zip |
Imports: make description import optional
-rw-r--r-- | chimere/locale/fr/LC_MESSAGES/django.po | 288 | ||||
-rw-r--r-- | chimere/migrations/0043_auto__add_field_importer_get_description.py | 245 | ||||
-rw-r--r-- | chimere/models.py | 4 | ||||
-rw-r--r-- | chimere/static/chimere/js/importer_interface.js | 8 | ||||
-rw-r--r-- | chimere/utils.py | 18 |
5 files changed, 411 insertions, 152 deletions
diff --git a/chimere/locale/fr/LC_MESSAGES/django.po b/chimere/locale/fr/LC_MESSAGES/django.po index 64ed511..93810c3 100644 --- a/chimere/locale/fr/LC_MESSAGES/django.po +++ b/chimere/locale/fr/LC_MESSAGES/django.po @@ -7,21 +7,13 @@ msgid "" msgstr "" "Project-Id-Version: 0.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-12-08 00:17+0100\n" +"POT-Creation-Date: 2013-01-31 15:48+0100\n" "PO-Revision-Date: 2010-03-20 20:00+0100\n" "Last-Translator: Étienne Loks <etienne.loks@peacefrogs.net>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: __init__.py:8 models.py:649 -msgid "Multimedia files" -msgstr "Fichiers multimedias" - -#: __init__.py:9 models.py:721 -msgid "Picture files" -msgstr "Fichiers d'image" - #: actions.py:31 msgid "View" msgstr "Voir" @@ -67,73 +59,73 @@ msgstr "Exporter en Shapefile" msgid "Export to CSV" msgstr "Exporter en CSV" -#: admin.py:101 +#: admin.py:102 msgid "Only one item can be managed at a time." msgstr "Seul un élément à la fois peut-être géré." -#: admin.py:110 +#: admin.py:112 msgid "No modified item associated to the selected item." msgstr "Pas d'élément modifié associé à l'élément sélectionné." -#: admin.py:156 +#: admin.py:158 msgid "Modified item traited." msgstr "Élément modifié traité." -#: admin.py:161 +#: admin.py:163 msgid "Managed modified items" msgstr "Gérer les éléments modifiés" -#: admin.py:195 admin.py:270 +#: admin.py:197 admin.py:272 msgid "Submitter" msgstr "Demandeur" -#: admin.py:200 admin.py:275 admin.py:326 +#: admin.py:202 admin.py:277 admin.py:328 msgid "Import" msgstr "Import" -#: admin.py:205 admin.py:280 +#: admin.py:207 admin.py:282 msgid "Associated items" msgstr "Éléments associés" -#: admin.py:332 +#: admin.py:334 msgid "Cancel import" msgstr "Annuler l'import" -#: admin.py:338 +#: admin.py:340 msgid "Cancel export" msgstr "Annuler l'export" -#: admin.py:342 +#: admin.py:344 msgid "Can manage only one OSM export at a time." msgstr "Ne peux gérer qu'un seul export OSM à la fois." -#: admin.py:347 +#: admin.py:349 msgid "" "You must treat all item with the status \"imported\" before exporting to OSM." msgstr "" "Vous devez traiter tous les éléments avec le status « importé » avant " "d'exporter vers OSM." -#: admin.py:351 +#: admin.py:353 msgid "Only OSM importer are managed for export." msgstr "Seul les imports de type OSM peuvent être gérés pour les exports." -#: admin.py:358 +#: admin.py:360 msgid "No point of interest are concerned by this export." msgstr "Aucun point d'intérêt n'est concerné par cet export." -#: admin.py:370 +#: admin.py:372 msgid "Export launched." msgstr "Export lancé." -#: admin.py:374 +#: admin.py:376 #, python-format msgid "" "%s point(s) of interest concerned by this export before bounding box filter." msgstr "" "%s point(s) d'intérêt concerné par cet export (avant le filtre sur la zone)" -#: admin.py:379 +#: admin.py:381 msgid "Export to osm" msgstr "Exporter vers osm" @@ -174,7 +166,7 @@ msgstr "Objet" msgid "OSM user" msgstr "Utilisateur OSM" -#: forms.py:98 models.py:1338 +#: forms.py:98 models.py:1349 msgid "Password" msgstr "Mot de passe" @@ -236,15 +228,15 @@ msgid "Bad file format: this must be a GPX or KML file" msgstr "Mauvais format de fichier : KML et GPX sont supportés" #: forms.py:471 models.py:51 models.py:106 models.py:127 models.py:140 -#: models.py:155 models.py:273 models.py:583 models.py:639 models.py:698 -#: models.py:814 models.py:1143 models.py:1155 models.py:1328 utils.py:469 +#: models.py:155 models.py:276 models.py:593 models.py:649 models.py:708 +#: models.py:824 models.py:1153 models.py:1165 models.py:1339 utils.py:476 #: templates/admin/chimere/managed_modified.html:23 #: templates/chimere/edit.html:39 templates/chimere/edit_route.html:36 #: templates/chimere/blocks/alternate_multimedia.html:38 msgid "Name" msgstr "Nom" -#: forms.py:480 models.py:1192 +#: forms.py:480 models.py:1202 msgid "Area" msgstr "Zone" @@ -258,12 +250,12 @@ msgid "The area \"%s\" has the same order, you need to choose another one." msgstr "" "La zone « %s » a le même numéro d'ordre, vous devez un choisir un autre." -#: models.py:52 models.py:128 models.py:156 models.py:284 models.py:587 -#: models.py:1161 models.py:1330 +#: models.py:52 models.py:128 models.py:156 models.py:287 models.py:597 +#: models.py:1171 models.py:1341 msgid "Available" msgstr "Disponible" -#: models.py:53 models.py:1339 +#: models.py:53 models.py:1350 msgid "Date" msgstr "Date" @@ -291,8 +283,8 @@ msgstr "Thème de couleur" msgid "Code" msgstr "Code" -#: models.py:116 models.py:129 models.py:162 models.py:641 models.py:713 -#: models.py:1160 models.py:1317 models.py:1329 +#: models.py:116 models.py:129 models.py:162 models.py:651 models.py:723 +#: models.py:1170 models.py:1328 models.py:1340 msgid "Order" msgstr "Ordre" @@ -304,16 +296,16 @@ msgstr "Couleur" msgid "Category" msgstr "Catégorie" -#: models.py:141 models.py:579 models.py:699 models.py:880 +#: models.py:141 models.py:589 models.py:709 models.py:890 #: templates/chimere/blocks/alternate_multimedia.html:42 msgid "Image" msgstr "Image" -#: models.py:143 models.py:701 models.py:882 +#: models.py:143 models.py:711 models.py:892 msgid "Height" msgstr "Hauteur" -#: models.py:144 models.py:702 models.py:883 +#: models.py:144 models.py:712 models.py:893 msgid "Width" msgstr "Largeur" @@ -329,7 +321,7 @@ msgstr "Disponible pour soumission" msgid "Marker" msgstr "Point d'intérêt" -#: models.py:164 models.py:876 models.py:893 +#: models.py:164 models.py:886 models.py:903 #: templates/chimere/edit_route.html:27 msgid "Route" msgstr "Trajet" @@ -382,287 +374,299 @@ msgstr "Fichier zippé" msgid "Overwrite existing data" msgstr "Écraser les données existantes" -#: models.py:243 models.py:300 +#: models.py:244 +msgid "Get description from source" +msgstr "Obtenir une description depuis la source de données" + +#: models.py:246 models.py:303 msgid "Origin" msgstr "Origine" -#: models.py:245 models.py:302 +#: models.py:248 models.py:305 msgid "License" msgstr "Licence" -#: models.py:248 +#: models.py:251 msgid "Associated subcategories" msgstr "Sous-catégories associées" -#: models.py:249 utils.py:473 +#: models.py:252 utils.py:480 msgid "State" msgstr "État" -#: models.py:251 +#: models.py:254 msgid "Automatically associate a marker to a way" msgstr "Associer automatiquement un marqueur à une route" -#: models.py:255 +#: models.py:258 msgid "Importer" msgstr "Import" -#: models.py:275 +#: models.py:278 msgid "Submitter session key" msgstr "Clé de session du demandeur" -#: models.py:277 +#: models.py:280 msgid "Submitter name or nickname" msgstr "Nom ou pseudo du demandeur" -#: models.py:279 +#: models.py:282 msgid "Submitter email" msgstr "Courriel du demandeur" -#: models.py:281 +#: models.py:284 msgid "Submitter comment" msgstr "Commentaire du demandeur" -#: models.py:283 +#: models.py:286 msgid "Submited" msgstr "Soumis" -#: models.py:285 +#: models.py:288 msgid "Modified" msgstr "Modifié" -#: models.py:286 +#: models.py:289 msgid "Disabled" msgstr "Désactivé" -#: models.py:287 +#: models.py:290 msgid "Imported" msgstr "Importé" -#: models.py:289 +#: models.py:292 msgid "Status" msgstr "État" -#: models.py:290 +#: models.py:293 msgid "Import key" msgstr "Clé d'import" -#: models.py:292 +#: models.py:295 msgid "Import version" msgstr "Version de l'import" -#: models.py:294 +#: models.py:297 msgid "Source" msgstr "Source" -#: models.py:296 +#: models.py:299 msgid "Modified since last import" msgstr "Modifié depuis le dernier import" -#: models.py:298 +#: models.py:301 msgid "Not to be exported to OSM" msgstr "À ne pas exporter vers OSM" -#: models.py:304 templates/chimere/edit.html:56 +#: models.py:307 templates/chimere/edit.html:56 #: templates/chimere/edit_route.html:52 msgid "Start date" msgstr "Date de début" -#: models.py:305 +#: models.py:308 msgid "Not mandatory. Set it for dated item such as event. Format YYYY-MM-DD" msgstr "" "Optionnel. Précisez ce champ pour les éléments datés comme un événement. " "Format du champ : AAAA-MM-JJ" -#: models.py:307 templates/chimere/edit.html:62 +#: models.py:310 templates/chimere/edit.html:62 #: templates/chimere/edit_route.html:58 msgid "End date" msgstr "Date de fin" -#: models.py:308 +#: models.py:311 msgid "" "Not mandatory. Set it only if you have a multi-day event. Format YYYY-MM-DD" msgstr "" "Optionnel. Précisez ce champ seulement pour des événements durant plusieurs " "jours. Format du champ : AAAA-MM-JJ" -#: models.py:354 +#: models.py:364 msgid "Reference marker" msgstr "Point d'intérêt de référence" -#: models.py:355 utils.py:475 +#: models.py:365 utils.py:482 msgid "Localisation" msgstr "Localisation" -#: models.py:357 +#: models.py:367 msgid "Available Date" msgstr "Date de mise en disponibilité" -#: models.py:361 utils.py:474 templates/admin/chimere/managed_modified.html:31 +#: models.py:371 utils.py:481 templates/admin/chimere/managed_modified.html:31 #: templates/chimere/edit.html:49 templates/chimere/edit_route.html:46 msgid "Description" msgstr "Description" -#: models.py:423 models.py:1364 +#: models.py:433 models.py:1375 msgid "Point of interest" msgstr "Point d'intérêt" -#: models.py:577 +#: models.py:587 msgid "Audio" msgstr "Audio" -#: models.py:578 +#: models.py:588 msgid "Video" msgstr "Vidéo" -#: models.py:580 +#: models.py:590 msgid "Other" msgstr "Autre" -#: models.py:581 +#: models.py:591 msgid "Media type" msgstr "Type de media" -#: models.py:584 +#: models.py:594 msgid "Mime type" msgstr "Type mime" -#: models.py:586 +#: models.py:596 msgid "Inside an iframe" msgstr "À l'intérieur d'un iframe" -#: models.py:590 +#: models.py:600 msgid "Multimedia type" msgstr "Type de multimedia" -#: models.py:591 +#: models.py:601 msgid "Multimedia types" msgstr "Types de multimedia" -#: models.py:600 +#: models.py:610 msgid "Automatic recognition" msgstr "Reconnaissance automatique" -#: models.py:626 +#: models.py:636 msgid "Extension name" msgstr "Nom de l'extension" -#: models.py:628 +#: models.py:638 msgid "Associated multimedia type" msgstr "Type de multimedia associé" -#: models.py:632 +#: models.py:642 msgid "Multimedia extension" msgstr "Extension multimedia" -#: models.py:633 +#: models.py:643 msgid "Multimedia extensions" msgstr "Extensions multimedia" -#: models.py:640 +#: models.py:650 msgid "Url" msgstr "Url" -#: models.py:643 models.py:703 +#: models.py:653 models.py:713 msgid "Display inside the description?" msgstr "Apparaît dans la description ?" -#: models.py:648 +#: models.py:658 msgid "Multimedia file" msgstr "Fichier multimedia" -#: models.py:705 +#: models.py:659 +msgid "Multimedia files" +msgstr "Fichiers multimedias" + +#: models.py:715 msgid "Thumbnail" msgstr "Miniature" -#: models.py:709 +#: models.py:719 msgid "Thumbnail height" msgstr "Hauteur de la miniature" -#: models.py:711 +#: models.py:721 msgid "Thumbnail width" msgstr "Largeur de la miniature" -#: models.py:720 +#: models.py:730 msgid "Picture file" msgstr "Fichier d'image" -#: models.py:815 +#: models.py:731 +msgid "Picture files" +msgstr "Fichiers d'image" + +#: models.py:825 msgid "Raw file (gpx or kml)" msgstr "Fichier brut (gpx ou kml)" -#: models.py:817 +#: models.py:827 msgid "Simplified file" msgstr "Fichier simplifié" -#: models.py:819 +#: models.py:829 msgid "KML" msgstr "KML" -#: models.py:819 +#: models.py:829 msgid "GPX" msgstr "GPX" -#: models.py:824 +#: models.py:834 msgid "Route file" msgstr "Fichier de trajet" -#: models.py:825 +#: models.py:835 msgid "Route files" msgstr "Fichiers de trajet" -#: models.py:875 +#: models.py:885 msgid "Reference route" msgstr "Trajet de référence" -#: models.py:879 +#: models.py:889 msgid "Associated file" msgstr "Fichier associé" -#: models.py:884 +#: models.py:894 msgid "Has an associated marker" msgstr "Dispose d'un marqueur associé" -#: models.py:1144 +#: models.py:1154 msgid "Layer code" msgstr "Code pour la couche" -#: models.py:1150 +#: models.py:1160 msgid "Layer" msgstr "Couche" -#: models.py:1156 +#: models.py:1166 msgid "Area urn" msgstr "Urn de la zone" -#: models.py:1158 templates/chimere/blocks/welcome.html:3 +#: models.py:1168 templates/chimere/blocks/welcome.html:3 msgid "Welcome message" msgstr "Message d'accueil" -#: models.py:1162 +#: models.py:1172 msgid "Upper left corner" msgstr "Coin en haut à gauche" -#: models.py:1164 +#: models.py:1174 msgid "Lower right corner" msgstr "Coin en bas à droite" -#: models.py:1166 +#: models.py:1176 msgid "Default area" msgstr "Zone par défaut" -#: models.py:1167 +#: models.py:1177 msgid "Only one area is set by default" msgstr "Seule une zone est définie par défaut" -#: models.py:1171 +#: models.py:1181 msgid "Sub-categories checked by default" msgstr "Sous-catégories cochées par défaut" -#: models.py:1173 +#: models.py:1183 msgid "Sub-categories dynamicaly displayed" msgstr "Sous-categories affichées dynamiquement" -#: models.py:1174 +#: models.py:1184 msgid "" "If checked, categories are only displayed in the menu if they are available " "on the current extent." @@ -670,64 +674,64 @@ msgstr "" "Si coché, les catégories sont disponibles sur le menu seulement si elles " "apparaissent sur la zone affichée." -#: models.py:1178 models.py:1333 +#: models.py:1188 models.py:1344 msgid "Restricted to theses sub-categories" msgstr "Restreindre à ces sous-categories" -#: models.py:1179 +#: models.py:1189 msgid "If no sub-category is set all sub-categories are available" msgstr "" "Si aucune sous-catégorie n'est définie toutes les sous-catégories sont " "disponibles" -#: models.py:1181 +#: models.py:1191 msgid "Link to an external CSS" msgstr "Lien vers une feuille de style externe" -#: models.py:1183 +#: models.py:1193 msgid "Restrict to the area extent" msgstr "Restreindre à l'étendue de la zone" -#: models.py:1318 +#: models.py:1329 msgid "Default layer" msgstr "Couche par défaut" -#: models.py:1322 models.py:1323 +#: models.py:1333 models.py:1334 msgid "Layers" msgstr "Couches" -#: models.py:1331 +#: models.py:1342 msgid "Mandatory" msgstr "Obligatoire" -#: models.py:1334 +#: models.py:1345 msgid "" "If no sub-category is set all the property applies to all sub-categories" msgstr "" "Si aucune sous-catégorie n'est précisée, cette propriété est disponible pour " "toutes les sous-catégories" -#: models.py:1336 +#: models.py:1347 msgid "Text" msgstr "Texte" -#: models.py:1337 +#: models.py:1348 msgid "Long text" msgstr "Texte long" -#: models.py:1344 +#: models.py:1355 msgid "Type" msgstr "Type" -#: models.py:1349 models.py:1366 +#: models.py:1360 models.py:1377 msgid "Property model" msgstr "Modèle de propriété" -#: models.py:1367 +#: models.py:1378 msgid "Value" msgstr "Valeur" -#: models.py:1371 +#: models.py:1382 msgid "Property" msgstr "Propriété" @@ -781,69 +785,69 @@ msgstr "Export échoué" msgid "Export canceled" msgstr "Export annulé" -#: utils.py:134 utils.py:183 +#: utils.py:139 utils.py:188 msgid "Bad zip file" msgstr "Mauvais fichier zip" -#: utils.py:186 +#: utils.py:191 msgid "Missing file(s) inside the zip file" msgstr "Fichier(s) manquant(s) dans l'archive zip" -#: utils.py:227 +#: utils.py:232 msgid "Bad XML file" msgstr "Mauvais fichier XML" -#: utils.py:312 +#: utils.py:319 msgid "Error while reading the data source." msgstr "Erreur lors de la lecture de la source." -#: utils.py:330 +#: utils.py:337 #, python-format msgid "SRID cannot be guessed. The default SRID (%s) has been used." msgstr "Le SRID n'a pu être trouvé. Le SRID par défaut (%s) a été utilisé." -#: utils.py:351 +#: utils.py:358 msgid "Type of geographic item of this shapefile is not managed by Chimère." msgstr "" "Les types des éléments géographiques de ce fichier Shapefile ne sont pas " "gérés par Chimère." -#: utils.py:371 +#: utils.py:378 msgid "Bad Shapefile" msgstr "Mauvais fichier Shapefile" -#: utils.py:413 +#: utils.py:420 msgid "Could not create file!" msgstr "Ne peut pas créer le fichier !" -#: utils.py:424 +#: utils.py:431 msgid "Failed to create field" msgstr "Ne peut pas créer un champ" -#: utils.py:470 templates/admin/chimere/managed_modified.html:25 +#: utils.py:477 templates/admin/chimere/managed_modified.html:25 #: templates/chimere/edit.html:44 templates/chimere/edit_route.html:41 #: templates/chimere/main_map.html:13 #: templates/chimere/main_map_simple.html:10 msgid "Categories" msgstr "Catégories" -#: utils.py:503 +#: utils.py:510 msgid "Invalid CSV format" msgstr "Fichier CSV non valide" -#: utils.py:578 +#: utils.py:588 msgid "RSS feed is not well formed" msgstr "Flux RSS non valide" -#: utils.py:653 +#: utils.py:664 msgid "Nothing to import" msgstr "Rien à importer" -#: utils.py:741 +#: utils.py:748 msgid "New items imported - validate them before exporting" msgstr "Nouveaux éléments importés - valider ceux-ci avant d'exporter" -#: utils.py:743 +#: utils.py:750 msgid "" "There are items from a former import not yet validated - validate them " "before exporting" @@ -851,19 +855,19 @@ msgstr "" "Il y a des éléments d'un import précédent pas encore validé - Validez les " "avant d'exporter" -#: utils.py:755 +#: utils.py:762 msgid "Bad params - programming error" msgstr "Mauvais paramètres - erreur de programmation" -#: utils.py:765 +#: utils.py:772 msgid "Bad param" msgstr "Mauvais paramètre" -#: utils.py:780 +#: utils.py:787 msgid "No non ambigious tag is defined in the XAPI request" msgstr "Pas de tag non ambigü définis dans la requête XAPI" -#: utils.py:782 +#: utils.py:789 msgid "" "No bounding box is defined in the XAPI request.If you are sure to manage the " "entire planet set the bounding box to -180,-90,180,90" @@ -1147,8 +1151,8 @@ msgid "" "<a href='%(rapprochement_form)s'>rapprochement form</a>.\n" msgstr "" "\n" -"Cet élément a un élément de référence associé. Vous devriez le traiter via le " -"<a href='%(rapprochement_form)s'>formulaire de rapprochement</a>.\n" +"Cet élément a un élément de référence associé. Vous devriez le traiter via " +"le <a href='%(rapprochement_form)s'>formulaire de rapprochement</a>.\n" #: templates/admin/chimere/propertymodel/change_form.html:5 msgid "" diff --git a/chimere/migrations/0043_auto__add_field_importer_get_description.py b/chimere/migrations/0043_auto__add_field_importer_get_description.py new file mode 100644 index 0000000..295d3b2 --- /dev/null +++ b/chimere/migrations/0043_auto__add_field_importer_get_description.py @@ -0,0 +1,245 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Importer.get_description' + db.add_column('chimere_importer', 'get_description', + self.gf('django.db.models.fields.BooleanField')(default=False), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Importer.get_description' + db.delete_column('chimere_importer', 'get_description') + + + models = { + 'chimere.area': { + 'Meta': {'ordering': "('order', 'name')", 'object_name': 'Area'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'default': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'default_subcategories': ('chimere.widgets.SelectMultipleField', [], {'to': "orm['chimere.SubCategory']", 'symmetrical': 'False', 'blank': 'True'}), + 'dynamic_categories': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'external_css': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'layers': ('chimere.widgets.SelectMultipleField', [], {'symmetrical': 'False', 'related_name': "'areas'", 'blank': 'True', 'through': "orm['chimere.AreaLayers']", 'to': "orm['chimere.Layer']"}), + 'lower_right_corner': ('django.contrib.gis.db.models.fields.PointField', [], {'default': "'POINT(0 0)'"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}), + 'restrict_to_extent': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'subcategories': ('chimere.widgets.SelectMultipleField', [], {'symmetrical': 'False', 'related_name': "'areas'", 'blank': 'True', 'db_table': "'chimere_subcategory_areas'", 'to': "orm['chimere.SubCategory']"}), + 'upper_left_corner': ('django.contrib.gis.db.models.fields.PointField', [], {'default': "'POINT(0 0)'"}), + 'urn': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'blank': 'True'}), + 'welcome_message': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}) + }, + 'chimere.arealayers': { + 'Meta': {'ordering': "('order',)", 'object_name': 'AreaLayers'}, + 'area': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.Area']"}), + 'default': ('django.db.models.fields.NullBooleanField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'layer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.Layer']"}), + 'order': ('django.db.models.fields.IntegerField', [], {}) + }, + 'chimere.category': { + 'Meta': {'ordering': "['order']", 'object_name': 'Category'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {}) + }, + 'chimere.color': { + 'Meta': {'ordering': "['order']", 'object_name': 'Color'}, + 'code': ('django.db.models.fields.CharField', [], {'max_length': '6'}), + 'color_theme': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.ColorTheme']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'order': ('django.db.models.fields.IntegerField', [], {}) + }, + 'chimere.colortheme': { + 'Meta': {'object_name': 'ColorTheme'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}) + }, + 'chimere.icon': { + 'Meta': {'object_name': 'Icon'}, + 'height': ('django.db.models.fields.IntegerField', [], {}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'width': ('django.db.models.fields.IntegerField', [], {}) + }, + 'chimere.importer': { + 'Meta': {'object_name': 'Importer'}, + 'associate_marker_to_way': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'categories': ('chimere.widgets.SelectMultipleField', [], {'to': "orm['chimere.SubCategory']", 'symmetrical': 'False'}), + 'default_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'filtr': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'get_description': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'importer_type': ('django.db.models.fields.CharField', [], {'max_length': '4'}), + 'license': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'origin': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'overwrite': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'source': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'source_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'srid': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'state': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'zipped': ('django.db.models.fields.BooleanField', [], {'default': 'False'}) + }, + 'chimere.layer': { + 'Meta': {'object_name': 'Layer'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'layer_code': ('django.db.models.fields.TextField', [], {'max_length': '300'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}) + }, + 'chimere.marker': { + 'Meta': {'ordering': "('status', 'name')", 'object_name': 'Marker'}, + 'available_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}), + 'categories': ('chimere.widgets.SelectMultipleField', [], {'to': "orm['chimere.SubCategory']", 'symmetrical': 'False'}), + 'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'import_key': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'import_source': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'import_version': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'license': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'modified_since_import': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'not_for_osm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'origin': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'point': ('chimere.widgets.PointField', [], {}), + 'ref_item': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'submited_marker'", 'null': 'True', 'to': "orm['chimere.Marker']"}), + 'route': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'associated_marker'", 'null': 'True', 'to': "orm['chimere.Route']"}), + 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'submiter_comment': ('django.db.models.fields.TextField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'submiter_email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), + 'submiter_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'submiter_session_key': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}) + }, + 'chimere.multimediaextension': { + 'Meta': {'object_name': 'MultimediaExtension'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'multimedia_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'extensions'", 'to': "orm['chimere.MultimediaType']"}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '6'}) + }, + 'chimere.multimediafile': { + 'Meta': {'object_name': 'MultimediaFile'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'marker': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'multimedia_files'", 'to': "orm['chimere.Marker']"}), + 'miniature': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'multimedia_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.MultimediaType']", 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'}) + }, + 'chimere.multimediatype': { + 'Meta': {'object_name': 'MultimediaType'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'iframe': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'media_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'mime_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}) + }, + 'chimere.news': { + 'Meta': {'object_name': 'News'}, + 'areas': ('chimere.widgets.SelectMultipleField', [], {'symmetrical': 'False', 'to': "orm['chimere.Area']", 'null': 'True', 'blank': 'True'}), + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'content': ('django.db.models.fields.TextField', [], {}), + 'date': ('django.db.models.fields.DateField', [], {'auto_now_add': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '150'}) + }, + 'chimere.picturefile': { + 'Meta': {'object_name': 'PictureFile'}, + 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'marker': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pictures'", 'to': "orm['chimere.Marker']"}), + 'miniature': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1'}), + 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), + 'thumbnailfile': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'thumbnailfile_height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'thumbnailfile_width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'chimere.property': { + 'Meta': {'object_name': 'Property'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'marker': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.Marker']"}), + 'propertymodel': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.PropertyModel']"}), + 'value': ('django.db.models.fields.TextField', [], {}) + }, + 'chimere.propertymodel': { + 'Meta': {'ordering': "('order',)", 'object_name': 'PropertyModel'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mandatory': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {}), + 'subcategories': ('chimere.widgets.SelectMultipleField', [], {'symmetrical': 'False', 'related_name': "'properties'", 'blank': 'True', 'to': "orm['chimere.SubCategory']"}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '1'}) + }, + 'chimere.route': { + 'Meta': {'ordering': "('status', 'name')", 'object_name': 'Route'}, + 'associated_file': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.RouteFile']", 'null': 'True', 'blank': 'True'}), + 'categories': ('chimere.widgets.SelectMultipleField', [], {'to': "orm['chimere.SubCategory']", 'symmetrical': 'False'}), + 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'has_associated_marker': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'height': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'import_key': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'import_source': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'import_version': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'license': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'modified_since_import': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'not_for_osm': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'origin': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}), + 'ref_item': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'submited_route'", 'null': 'True', 'to': "orm['chimere.Route']"}), + 'route': ('chimere.widgets.RouteField', [], {}), + 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}), + 'status': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'submiter_comment': ('django.db.models.fields.TextField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'submiter_email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}), + 'submiter_name': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'submiter_session_key': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}), + 'width': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}) + }, + 'chimere.routefile': { + 'Meta': {'ordering': "('name',)", 'object_name': 'RouteFile'}, + 'file_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'raw_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}), + 'simplified_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}) + }, + 'chimere.subcategory': { + 'Meta': {'ordering': "['category', 'order']", 'object_name': 'SubCategory'}, + 'available': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'subcategories'", 'to': "orm['chimere.Category']"}), + 'color_theme': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.ColorTheme']", 'null': 'True', 'blank': 'True'}), + 'icon': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['chimere.Icon']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'item_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '150'}), + 'order': ('django.db.models.fields.IntegerField', [], {'default': '1000'}), + 'submission': ('django.db.models.fields.BooleanField', [], {'default': 'True'}) + }, + 'chimere.tinyurl': { + 'Meta': {'object_name': 'TinyUrl'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'parameters': ('django.db.models.fields.CharField', [], {'max_length': '500'}) + } + } + + complete_apps = ['chimere']
\ No newline at end of file diff --git a/chimere/models.py b/chimere/models.py index 79252f6..a9b4a32 100644 --- a/chimere/models.py +++ b/chimere/models.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2008-2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2008-2013 É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 @@ -241,6 +241,8 @@ class Importer(models.Model): zipped = models.BooleanField(_(u"Zipped file"), default=False) overwrite = models.BooleanField(_(u"Overwrite existing data"), default=False) + get_description = models.BooleanField(_(u"Get description from source"), + default=False) origin = models.CharField(_(u"Origin"), max_length=100, blank=True, null=True) license = models.CharField(_(u"License"), max_length=100, diff --git a/chimere/static/chimere/js/importer_interface.js b/chimere/static/chimere/js/importer_interface.js index aa332d4..0b563b6 100644 --- a/chimere/static/chimere/js/importer_interface.js +++ b/chimere/static/chimere/js/importer_interface.js @@ -4,16 +4,18 @@ django.jQuery(function($) { 'field-source', 'field-overwrite'), KML:new Array('field-source', 'field-source_file', 'field-default_name', 'field-filtr', 'field-zipped', 'field-origin', - 'field-license', 'field-categories', 'field-overwrite'), + 'field-license', 'field-categories', 'field-overwrite', + 'field-get_description'), SHP:new Array('field-source', 'field-source_file', 'field-default_name', 'field-zipped', 'field-origin', 'field-srid', 'field-license', 'field-categories', 'field-overwrite'), RSS:new Array('field-source', 'field-default_name', 'field-origin', 'field-srid', 'field-license', 'field-categories', - 'field-overwrite'), + 'field-overwrite', 'field-get_description'), CSV:new Array('field-source', 'field-source_file', 'field-default_name', 'field-origin', 'field-srid', 'field-license', - 'field-categories', 'field-overwrite') + 'field-categories', 'field-overwrite', + 'field-get_description') } var map_initialized; function refresh_importer_form(){ diff --git a/chimere/utils.py b/chimere/utils.py index fe1a8a1..c4e882b 100644 --- a/chimere/utils.py +++ b/chimere/utils.py @@ -241,6 +241,7 @@ class KMLManager(ImportManager): pl_id = placemark.attrib.get('id') pl_key = 'kml-%d' % self.importer_instance.pk ns = '{%s}' % self.ns + description = '' for item in placemark: if item.tag == ns + 'name': name = item.text @@ -248,7 +249,8 @@ class KMLManager(ImportManager): # if no ID is provided assume that name is a key pl_id = name elif item.tag == ns + 'description': - description = item.text + if self.importer_instance.get_description: + description = item.text elif item.tag == ns + 'Point': for coord in item: if coord.tag == ns + 'coordinates': @@ -510,7 +512,10 @@ class CSVManager(ImportManager): if len(row) < len(cols): continue pk, name, cats, state = row[0], row[1], row[2], row[3] - description, geom = row[4], row[5] + geom = row[5] + description = '' + if self.importer_instance.get_description: + description = row[4] COL_INDEX = 6 dct = {'description':description, 'name':name, @@ -599,10 +604,11 @@ class GeoRSSManager(ImportManager): y = item['geo_lat'] x = item['geo_long'] dct['point'] = 'SRID=4326;POINT(%s %s)' % (x, y) - for k in ['description', 'summary', 'value']: - if k in item: - dct['description'] = item[k] - break + if self.importer_instance.get_description: + for k in ['description', 'summary', 'value']: + if k in item: + dct['description'] = item[k] + break else: cls = Route points = item['georss_line'].split(' ') |