diff options
| author | Le Jeune Yann <lj.yann@gmail.com> | 2011-01-29 13:24:20 +0100 |
|---|---|---|
| committer | Le Jeune Yann <lj.yann@gmail.com> | 2011-01-29 13:24:20 +0100 |
| commit | d690055480ef14bf51b6d172f8a2af19e080e5ce (patch) | |
| tree | d1d385f9f529231bf500550dce9f37342d8e8187 /ishtar | |
| parent | def6a737e306aa04d6030475a793eb0c105b0065 (diff) | |
| parent | cf50fe45a889946d62a5428fd50f68a349505180 (diff) | |
| download | Ishtar-d690055480ef14bf51b6d172f8a2af19e080e5ce.tar.bz2 Ishtar-d690055480ef14bf51b6d172f8a2af19e080e5ce.zip | |
Merge branch 'master' of ssh://lysithea.proxience.com/home/proxience/git/ishtar
Diffstat (limited to 'ishtar')
| -rw-r--r-- | ishtar/furnitures/admin.py | 5 | ||||
| -rw-r--r-- | ishtar/furnitures/forms.py | 48 | ||||
| -rw-r--r-- | ishtar/furnitures/models.py | 17 | ||||
| -rw-r--r-- | ishtar/furnitures/urls.py | 4 | ||||
| -rw-r--r-- | ishtar/furnitures/views.py | 99 | ||||
| -rw-r--r-- | ishtar/furnitures/widgets.py | 99 | ||||
| -rw-r--r-- | ishtar/locale/fr/LC_MESSAGES/django.po | 476 | ||||
| -rw-r--r-- | ishtar/scripts/__init__.py | 0 | ||||
| -rwxr-xr-x | ishtar/scripts/import_from_csv.py | 68 | ||||
| -rwxr-xr-x | ishtar/scripts/import_towns_from_osm.py | 110 | ||||
| -rw-r--r-- | ishtar/settings.py.example | 8 | ||||
| -rw-r--r-- | ishtar/templates/base.html | 2 | ||||
| -rw-r--r-- | ishtar/templates/confirm_wizard.html | 2 | ||||
| -rw-r--r-- | ishtar/templates/default_wizard.html | 5 | ||||
| -rw-r--r-- | ishtar/urls.py | 2 |
15 files changed, 704 insertions, 241 deletions
diff --git a/ishtar/furnitures/admin.py b/ishtar/furnitures/admin.py index 7ffe387fd..83862f32a 100644 --- a/ishtar/furnitures/admin.py +++ b/ishtar/furnitures/admin.py @@ -166,8 +166,11 @@ admin.site.register(models.Container, ContainerAdmin) class TownAdmin(admin.ModelAdmin): list_display = ['name',] + search_fields = ['name'] if settings.COUNTRY == 'fr': - list_display += ['canton'] + list_display += ['numero_insee', 'departement', ] + search_fields += ['numero_insee', 'departement__label', ] + list_filter = ("departement",) model = models.Town admin.site.register(models.Town, TownAdmin) diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py index 82bfcb88e..c49367ab4 100644 --- a/ishtar/furnitures/forms.py +++ b/ishtar/furnitures/forms.py @@ -652,7 +652,31 @@ class FileWizard(Wizard): parcel.save() return res +class FileSelect(forms.Form): + town = forms.IntegerField(label=_(u"Town"), + widget=widgets.JQueryAutoComplete("/" + settings.URL_PATH + \ + 'autocomplete-town', associated_model=models.Town), + validators=[models.valid_id(models.Town)]) + file_type = forms.ChoiceField(label=_("File type"), + choices=models.FileType.get_types()) + year = forms.IntegerField(label=_("Year")) + +class FileFormSelection(forms.Form): + form_label = _("Archaelogical file") + associated_models = {'pk':models.File} + currents = {'pk':models.File} + pk = forms.IntegerField(label="", required=False, + widget=widgets.JQueryJqGrid(reverse_lazy('json-file'), + FileSelect(), ['file_type', 'year']), + validators=[models.valid_id(models.File)]) + + def clean(self): + cleaned_data = self.cleaned_data + if 'pk' not in cleaned_data or not cleaned_data['pk']: + raise forms.ValidationError(_(u"You should select a file.")) + return cleaned_data +""" class FileFormSelection(forms.Form): form_label = _("Archaelogical file") associated_models = {'pk':models.File} @@ -661,6 +685,7 @@ class FileFormSelection(forms.Form): widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-file'), associated_model=models.File), validators=[models.valid_id(models.File)]) +""" class FileFormGeneral(forms.Form): form_label = _("General") @@ -1066,15 +1091,36 @@ class OperationWizard(Wizard): + datas return datas +class OperationSelect(forms.Form): + town = forms.IntegerField(label=_(u"Town"), + widget=widgets.JQueryAutoComplete("/" + settings.URL_PATH + \ + 'autocomplete-town', associated_model=models.Town), + validators=[models.valid_id(models.Town)]) + operation_type = forms.ChoiceField(label=_("Operation type"), + choices=models.OperationType.get_types()) + year = forms.IntegerField(label=_("Year")) + class OperationFormSelection(forms.Form): form_label = _("Operation") associated_models = {'pk':models.Operation} currents = {'pk':models.Operation} + pk = forms.IntegerField(label="", required=False, + widget=widgets.JQueryJqGrid(reverse_lazy('json-operation'), + OperationSelect(), ['operation_type', 'year']), + validators=[models.valid_id(models.Operation)]) + + def clean(self): + cleaned_data = self.cleaned_data + if 'pk' not in cleaned_data or not cleaned_data['pk']: + raise forms.ValidationError(_(u"You should select an operation.")) + return cleaned_data + + """ pk = forms.IntegerField(label=_("Operation"), widget=widgets.JQueryAutoComplete(reverse_lazy('autocomplete-operation'), associated_model=models.Operation), validators=[models.valid_id(models.Operation)]) - +""" class OperationFormGeneral(forms.Form): form_label = _("General") diff --git a/ishtar/furnitures/models.py b/ishtar/furnitures/models.py index f7cc8288c..5c19f050f 100644 --- a/ishtar/furnitures/models.py +++ b/ishtar/furnitures/models.py @@ -144,11 +144,12 @@ class LightHistorizedItem(BaseHistorizedItem): class Departement(models.Model): label = models.CharField(_(u"Label"), max_length=30) - number = models.IntegerField(_(u"Number")) + number = models.CharField(_(u"Number"), unique=True, max_length=3) class Meta: verbose_name = _(u"Departement") verbose_name_plural = _(u"Departements") + ordering = ['number'] def __unicode__(self): return unicode(self.number) + u" - " + self.label @@ -669,10 +670,14 @@ if settings.COUNTRY == 'fr': class Town(models.Model): name = models.CharField(_(u"Name"), max_length=100) - surface = models.IntegerField(_(u"Surface")) - center = models.PointField(_(u"Localisation"), srid=settings.SRID) + surface = models.IntegerField(_(u"Surface"), blank=True, null=True) + center = models.PointField(_(u"Localisation"), srid=settings.SRID, + blank=True, null=True) if settings.COUNTRY == 'fr': - numero_insee = models.CharField(u"Numéro INSEE", max_length=5) + numero_insee = models.CharField(u"Numéro INSEE", max_length=6, + unique=True) + departement = models.ForeignKey(Departement, verbose_name=u"Département", + null=True, blank=True) canton = models.ForeignKey(Canton, verbose_name=u"Canton", null=True, blank=True) objects = models.GeoManager() @@ -680,8 +685,12 @@ class Town(models.Model): class Meta: verbose_name = _(u"Town") verbose_name_plural = _(u"Towns") + if settings.COUNTRY == 'fr': + ordering = ['numero_insee'] def __unicode__(self): + if settings.COUNTRY == "fr": + return " - ".join((self.name, self.numero_insee)) return self.name class TreatmentType(GeneralType): diff --git a/ishtar/furnitures/urls.py b/ishtar/furnitures/urls.py index 08af1cd42..d20ae6035 100644 --- a/ishtar/furnitures/urls.py +++ b/ishtar/furnitures/urls.py @@ -69,8 +69,12 @@ urlpatterns += patterns('ishtar.furnitures.views', name='autocomplete-organization'), url(BASE_URL + r'autocomplete-file/$', 'autocomplete_file', name='autocomplete-file'), + url(BASE_URL + r'json-file/$', 'json_file', + name='json-file'), url(BASE_URL + r'autocomplete-operation/$', 'autocomplete_operation', name='autocomplete-operation'), + url(BASE_URL + r'json-operation/$', 'json_operation', + name='json-operation'), url(BASE_URL + r'update-current-item/$', 'update_current_item', name='update-current-item'), ) diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 03029cfe4..041ebfb76 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -91,9 +91,8 @@ def autocomplete_town(request): for q in q.split(' '): extra = Q(name__icontains=q) if settings.COUNTRY == 'fr': - extra = extra | (Q(canton__name__istartswith=q) | \ - Q(canton__arrondissement__name__istartswith=q) | \ - Q(canton__arrondissement__department__label__istartswith=q)) + extra = (extra | Q(numero_insee__istartswith=q) | \ + Q(departement__label__istartswith=q)) query = query & extra limit = 15 towns = models.Town.objects.filter(query)[:limit] @@ -121,6 +120,52 @@ def autocomplete_file(request): for file in files]) return HttpResponse(data, mimetype='text/plain') +def json_file(request): + if not request.GET: + return HttpResponse(mimetype='text/plain') + request_keys = {'town':'towns__pk', + 'file_type':'file_type__pk', + 'year':'year', + 'value':'name', + } + dct = {} + for k in request_keys: + q = request.GET.get(k) + if not q: + continue + dct[request_keys[k]] = q + if not dct: + if 'json_file' in request.session: + dct = request.session['json_file'] + elif 'file' in request.session: + dct = {"pk":request.session['file']} + if not dct: + return HttpResponse(mimetype='text/plain') + else: + request.session['json_file'] = dct + query = Q(**dct) + files = models.File.objects.filter(query) + q = request.GET.get('sidx') + if q and q in request_keys: + k = request_keys[q] + if k.endswith("__pk"): + k = k[:-len("__pk")] + "__label" + q = request.GET.get('sord') + sign = q and q == u'desc' and "-" or '' + if k == "name": + files = files.order_by(sign + 'year').order_by( + sign + 'numeric_reference') + else: + files = files.order_by(sign + k) + data = json.dumps({ + "records":len(files), + "rows":[{"id":unicode(fle.pk), + "cell":(unicode(fle.pk), unicode(fle), + unicode(fle.file_type), unicode(fle.year))} + for fle in files] + }) + return HttpResponse(data, mimetype='text/plain') + def autocomplete_operation(request, non_closed=True): if not request.GET.get('term'): return HttpResponse(mimetype='text/plain') @@ -142,6 +187,54 @@ def autocomplete_operation(request, non_closed=True): for operation in operations]) return HttpResponse(data, mimetype='text/plain') +def json_operation(request, non_closed=True): + if not request.GET: + return HttpResponse(mimetype='text/plain') + request_keys = {'town':'towns__pk', + 'operation_type':'operation_type__pk', + 'operation_code':'operation_code', + 'year':'year', + 'value':'name', + } + dct = {} + for k in request_keys: + q = request.GET.get(k) + if not q: + continue + dct[request_keys[k]] = q + if not dct: + if 'json_operation' in request.session: + dct = request.session['json_operation'] + elif 'operation' in request.session: + dct = {"pk":request.session['operation']} + if not dct: + return HttpResponse(mimetype='text/plain') + else: + request.session['json_operation'] = dct + query = Q(**dct) + operations = models.Operation.objects.filter(query) + q = request.GET.get('sidx') + if q and q in request_keys: + k = request_keys[q] + if k.endswith("__pk"): + k = k[:-len("__pk")] + "__label" + q = request.GET.get('sord') + sign = q and q == u'desc' and "-" or '' + if k == "name": + k = "operation_code" + operations = operations.order_by(sign + 'year').order_by( + sign + 'operation_code') + else: + operations = operations.order_by(sign + k) + data = json.dumps({ + "records":len(operations), + "rows":[{"id":unicode(operation.pk), + "cell":(unicode(operation.pk), unicode(operation), + unicode(operation.operation_type), unicode(operation.year))} + for operation in operations] + }) + return HttpResponse(data, mimetype='text/plain') + def autocomplete_organization(request, orga_type=None): if not request.GET.get('term'): return HttpResponse(mimetype='text/plain') diff --git a/ishtar/furnitures/widgets.py b/ishtar/furnitures/widgets.py index dc00f8676..af22c7b3e 100644 --- a/ishtar/furnitures/widgets.py +++ b/ishtar/furnitures/widgets.py @@ -48,7 +48,6 @@ class JQueryDate(forms.TextInput): """ % (name, settings.COUNTRY)
return rendered
-
class JQueryAutoComplete(forms.TextInput):
def __init__(self, source, associated_model=None, options={}, attrs={}):
"""
@@ -121,3 +120,101 @@ objects.get(pk=value)) 'js' : self.render_js(name),
}
+class JQueryJqGrid(forms.RadioSelect):
+ COL_TPL = "{name:'%(idx)s', index:'%(idx)s', sortable:true}"
+ class Media:
+ js = ['%s/js/i18n/grid.locale-%s.js' % (settings.MEDIA_URL,
+ settings.COUNTRY),
+ '%s/js/jquery.jqGrid.min.js' % settings.MEDIA_URL,
+ ]
+ css = {'all':['%s/media/ui.jqgrid.css' % settings.MEDIA_URL]}
+
+ def __init__(self, source, form, cols, attrs={}):
+ self.source = source
+ self.form = form
+ self.attrs = attrs
+ self.cols = cols
+
+ def render(self, name, value=None, attrs=None):
+ rendered = unicode(self.form)
+ """
+ for k in self.form.fields:
+ field = self.form.fields[k]
+ print unicode(field)
+ print field.label_tag
+ rendered += u"<tr><td>%s</td><td>%s</td></tr>" % (field.label_tag,
+ unicode(field))
+ """
+ rendered += """
+</table>
+<button id='search_%s' class='submit'>%s</button>
+<h4>%s</h4>
+""" % (name, unicode(_("Search")), unicode(_("Search and select an item")))
+ extra_cols = []
+ col_names, col_idx = [], []
+ for k in self.form.fields:
+ field = self.form.fields[k]
+ col_idx.append(u'"%s"' % k)
+ if k in self.cols:
+ col_names.append(u'"%s"' % field.label)
+ extra_cols.append(self.COL_TPL % {'idx':k})
+ col_names = col_names and ",".join([""]+col_names) or ""
+ col_idx = col_idx and ",".join(col_idx) or ""
+ extra_cols = extra_cols and ",".join([""]+extra_cols) or ""
+ rendered += """<table id="grid_%s" class='jqgrid'></table>
+<div id="pager_%s"></div>
+<input type="hidden" id="hidden_%s" name="%s">""" % (name, name, name, name)
+ rendered += """
+<script type="text/javascript">
+var query_vars = new Array(%(col_idx)s);
+jQuery(document).ready(function(){
+jQuery("#submit_form").click(function (){
+ var mygrid = jQuery("#grid_%(name)s");
+ jQuery("#hidden_%(name)s").val(mygrid.getGridParam('selrow'));
+ return true;
+});
+jQuery("#search_%(name)s").click(function (){
+ var data = "";
+ for (idx in query_vars)
+ {
+ var key = query_vars[idx];
+ var val = jQuery("#id_"+key).val();
+ if (val){
+ if (data) data += "&";
+ data += key + "=" + val;
+ }
+ }
+ var mygrid = jQuery("#grid_%(name)s");
+ var url = "%(source)s?" + data;
+ mygrid.setGridParam({url:url});
+ mygrid.trigger("reloadGrid");
+ return false;
+});
+
+jQuery("#grid_%(name)s").jqGrid({
+ url:'%(source)s',
+ datatype: "json",
+ mtype: 'GET',
+ colNames:['id', '%(name_label)s'%(col_names)s],
+ colModel:[
+{name:'id', index:'id', hidden:true},
+{name:'value', index:'value'}%(extra_cols)s
+ ],
+ sortname: 'value',
+ viewrecords: true,
+ sortorder: "asc",
+ emptyrecords: "%(no_result)s",
+ loadtext: "%(loading)s",
+ pager: '#pager_%(name)s',
+ pgbuttons: false,
+ pginput: false,
+ width:500
+});
+});
+</script>
+""" % {'name':name, 'col_names':col_names, 'extra_cols':extra_cols,
+ 'name_label':unicode(_("Name")), 'source':unicode(self.source),
+ 'col_idx':col_idx, 'no_result':unicode(_("No results")),
+ 'loading':unicode(_("Loading..."))}
+ return rendered
+
diff --git a/ishtar/locale/fr/LC_MESSAGES/django.po b/ishtar/locale/fr/LC_MESSAGES/django.po index 72e59a511..3746faae0 100644 --- a/ishtar/locale/fr/LC_MESSAGES/django.po +++ b/ishtar/locale/fr/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: alpha\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-20 02:47+0100\n" +"POT-Creation-Date: 2011-01-28 17:08+0100\n" "PO-Revision-Date: 2010-12-09\n" "Last-Translator: Étienne Loks <etienne.loks at peacefrogs net>\n" "Language-Team: \n" @@ -29,13 +29,13 @@ msgid "email address" msgstr "courriel" #: furnitures/context_processors.py:42 furnitures/forms.py:657 -#: furnitures/forms.py:1090 furnitures/models.py:590 furnitures/models.py:612 +#: furnitures/forms.py:1111 furnitures/models.py:591 furnitures/models.py:613 msgid "Archaelogical file" msgstr "Dossier archéologique" -#: furnitures/context_processors.py:43 furnitures/forms.py:1070 -#: furnitures/forms.py:1073 furnitures/models.py:367 furnitures/models.py:396 -#: furnitures/models.py:591 furnitures/models.py:610 +#: furnitures/context_processors.py:43 furnitures/forms.py:1079 +#: furnitures/models.py:368 furnitures/models.py:397 furnitures/models.py:592 +#: furnitures/models.py:611 msgid "Operation" msgstr "Opération" @@ -47,9 +47,9 @@ msgstr "Confirmation" msgid "Enter a valid name consisting of letters, spaces and hyphens." msgstr "Entrez un nom correct composé de lettres, espaces et tirets." -#: furnitures/forms.py:407 furnitures/forms.py:410 furnitures/models.py:220 -#: furnitures/models.py:239 furnitures/models.py:698 furnitures/models.py:722 -#: furnitures/models.py:737 +#: furnitures/forms.py:407 furnitures/forms.py:410 furnitures/models.py:221 +#: furnitures/models.py:240 furnitures/models.py:707 furnitures/models.py:731 +#: furnitures/models.py:746 msgid "Person" msgstr "Individu" @@ -57,24 +57,24 @@ msgstr "Individu" msgid "Identity" msgstr "Identité" -#: furnitures/forms.py:419 furnitures/models.py:207 furnitures/models.py:479 +#: furnitures/forms.py:419 furnitures/models.py:208 furnitures/models.py:480 msgid "Title" msgstr "Titre" -#: furnitures/forms.py:420 furnitures/models.py:208 +#: furnitures/forms.py:420 furnitures/models.py:209 msgid "Surname" msgstr "Prénom" -#: furnitures/forms.py:422 furnitures/models.py:179 furnitures/models.py:209 -#: furnitures/models.py:569 furnitures/models.py:671 +#: furnitures/forms.py:422 furnitures/models.py:180 furnitures/models.py:210 +#: furnitures/models.py:570 furnitures/models.py:672 furnitures/widgets.py:216 msgid "Name" msgstr "Nom" -#: furnitures/forms.py:424 furnitures/forms.py:533 furnitures/models.py:210 +#: furnitures/forms.py:424 furnitures/forms.py:533 furnitures/models.py:211 msgid "Email" msgstr "Courriel" -#: furnitures/forms.py:426 furnitures/models.py:198 +#: furnitures/forms.py:426 furnitures/models.py:199 msgid "Person type" msgstr "Type d'individu" @@ -82,11 +82,11 @@ msgstr "Type d'individu" msgid "Current organization" msgstr "Organisation actuelle" -#: furnitures/forms.py:432 furnitures/models.py:214 +#: furnitures/forms.py:432 furnitures/models.py:215 msgid "Is an author?" msgstr "Est un auteur ?" -#: furnitures/forms.py:435 furnitures/models.py:216 +#: furnitures/forms.py:435 furnitures/models.py:217 msgid "In charge of a storage?" msgstr "Est responsable d'un dépôt ?" @@ -131,70 +131,71 @@ msgstr "Envoyer le nouveau mot de passe par courriel ?" msgid "References/location" msgstr "Référence/lieu" -#: furnitures/forms.py:666 furnitures/forms.py:1080 +#: furnitures/forms.py:666 furnitures/forms.py:1101 msgid "General" msgstr "Général" -#: furnitures/forms.py:669 furnitures/models.py:279 furnitures/models.py:573 +#: furnitures/forms.py:669 furnitures/models.py:280 furnitures/models.py:574 msgid "Person in charge" msgstr "Responsable" #: furnitures/forms.py:674 furnitures/forms.py:690 furnitures/forms.py:747 -#: furnitures/forms.py:1098 furnitures/models.py:272 furnitures/models.py:350 -#: furnitures/models.py:397 +#: furnitures/forms.py:1076 furnitures/forms.py:1119 furnitures/models.py:273 +#: furnitures/models.py:351 furnitures/models.py:398 msgid "Year" msgstr "Année" -#: furnitures/forms.py:678 furnitures/forms.py:692 furnitures/models.py:274 +#: furnitures/forms.py:678 furnitures/forms.py:692 furnitures/models.py:275 msgid "Numeric reference" msgstr "Référence numérique" -#: furnitures/forms.py:680 furnitures/forms.py:694 furnitures/models.py:275 +#: furnitures/forms.py:680 furnitures/forms.py:694 furnitures/models.py:276 msgid "Internal reference" msgstr "Référence interne" -#: furnitures/forms.py:682 furnitures/models.py:290 +#: furnitures/forms.py:682 furnitures/models.py:291 msgid "Creation date" msgstr "Date de création" -#: furnitures/forms.py:684 furnitures/models.py:277 +#: furnitures/forms.py:684 furnitures/models.py:278 msgid "File type" msgstr "Type de dossier" -#: furnitures/forms.py:686 furnitures/forms.py:1102 furnitures/models.py:111 -#: furnitures/models.py:307 furnitures/models.py:363 furnitures/models.py:574 -#: furnitures/models.py:649 +#: furnitures/forms.py:686 furnitures/forms.py:1123 furnitures/models.py:111 +#: furnitures/models.py:308 furnitures/models.py:364 furnitures/models.py:575 +#: furnitures/models.py:650 msgid "Comment" msgstr "Commentaire" -#: furnitures/forms.py:698 furnitures/models.py:157 +#: furnitures/forms.py:698 furnitures/models.py:158 msgid "Address" msgstr "Adresse" -#: furnitures/forms.py:700 furnitures/models.py:299 +#: furnitures/forms.py:700 furnitures/models.py:300 msgid "Total surface" msgstr "Surface totale" -#: furnitures/forms.py:703 furnitures/models.py:302 +#: furnitures/forms.py:703 furnitures/models.py:303 msgid "Main address" msgstr "Adresse principale" -#: furnitures/forms.py:704 furnitures/models.py:303 +#: furnitures/forms.py:704 furnitures/models.py:304 msgid "Main address - complement" msgstr "Adresse principale - complément" -#: furnitures/forms.py:706 furnitures/models.py:305 +#: furnitures/forms.py:706 furnitures/models.py:306 msgid "Main address - postal code" msgstr "Adresse principale - code postal" -#: furnitures/forms.py:710 furnitures/forms.py:736 furnitures/forms.py:1133 -#: furnitures/forms.py:1154 furnitures/forms.py:1158 furnitures/models.py:357 -#: furnitures/models.py:682 +#: furnitures/forms.py:710 furnitures/forms.py:736 furnitures/forms.py:1154 +#: furnitures/forms.py:1175 furnitures/forms.py:1179 furnitures/models.py:358 +#: furnitures/models.py:687 msgid "Towns" msgstr "Communes" -#: furnitures/forms.py:713 furnitures/forms.py:741 furnitures/forms.py:1135 -#: furnitures/models.py:162 furnitures/models.py:399 furnitures/models.py:681 +#: furnitures/forms.py:713 furnitures/forms.py:741 furnitures/forms.py:1070 +#: furnitures/forms.py:1156 furnitures/models.py:163 furnitures/models.py:400 +#: furnitures/models.py:686 msgid "Town" msgstr "Commune" @@ -202,15 +203,15 @@ msgstr "Commune" msgid "There are identical towns." msgstr "Il y a des communes identiques." -#: furnitures/forms.py:739 furnitures/forms.py:787 furnitures/models.py:405 +#: furnitures/forms.py:739 furnitures/forms.py:787 furnitures/models.py:406 msgid "Parcels" msgstr "Parcelles" -#: furnitures/forms.py:743 furnitures/models.py:400 +#: furnitures/forms.py:743 furnitures/models.py:401 msgid "Section" msgstr "Section" -#: furnitures/forms.py:745 furnitures/models.py:401 +#: furnitures/forms.py:745 furnitures/models.py:402 msgid "Parcel number" msgstr "Numéro de parcelle" @@ -222,23 +223,23 @@ msgstr "Il y a des parcelles identiques." msgid "Preventive informations" msgstr "Information archéologie préventive" -#: furnitures/forms.py:795 furnitures/models.py:281 +#: furnitures/forms.py:795 furnitures/models.py:282 msgid "General contractor" msgstr "Aménageur" -#: furnitures/forms.py:802 furnitures/models.py:283 +#: furnitures/forms.py:802 furnitures/models.py:284 msgid "Town planning service" msgstr "Service instructeur" -#: furnitures/forms.py:808 furnitures/models.py:261 furnitures/models.py:284 +#: furnitures/forms.py:808 furnitures/models.py:262 furnitures/models.py:285 msgid "Permit type" msgstr "Type de permis" -#: furnitures/forms.py:810 furnitures/models.py:286 +#: furnitures/forms.py:810 furnitures/models.py:287 msgid "Permit reference" msgstr "Référence du permis" -#: furnitures/forms.py:813 furnitures/models.py:300 +#: furnitures/forms.py:813 furnitures/models.py:301 msgid "Total developed surface" msgstr "Surface totale aménagée" @@ -246,7 +247,7 @@ msgstr "Surface totale aménagée" msgid "Saisine type" msgstr "Type de saisine" -#: furnitures/forms.py:819 furnitures/models.py:292 +#: furnitures/forms.py:819 furnitures/models.py:293 msgid "Reception date" msgstr "Date de réception" @@ -258,23 +259,23 @@ msgstr "Opérations associées" msgid "Would you like to delete this archaelogical file ?" msgstr "Voulez vous supprimer ce dossier archéologique ?" -#: furnitures/forms.py:975 furnitures/models.py:620 furnitures/models.py:736 +#: furnitures/forms.py:975 furnitures/models.py:621 furnitures/models.py:745 msgid "Administrative act" msgstr "Acte administratif" -#: furnitures/forms.py:976 furnitures/models.py:596 furnitures/models.py:600 +#: furnitures/forms.py:976 furnitures/models.py:597 furnitures/models.py:601 msgid "Act type" msgstr "Type d'acte" -#: furnitures/forms.py:978 furnitures/models.py:608 +#: furnitures/forms.py:978 furnitures/models.py:609 msgid "Signatory" msgstr "Signataire" -#: furnitures/forms.py:982 furnitures/models.py:614 +#: furnitures/forms.py:982 furnitures/models.py:615 msgid "Object" msgstr "Objet" -#: furnitures/forms.py:984 furnitures/models.py:613 +#: furnitures/forms.py:984 furnitures/models.py:614 msgid "Signature date" msgstr "Date de signature" @@ -286,29 +287,34 @@ msgstr "" "Attention : Aucun dossier archéologique n'a été précisé. S'il s'agit d'un " "oubli, définissez le à la première étape." -#: furnitures/forms.py:1085 furnitures/models.py:602 -msgid "Person in charge of the operation" -msgstr "Responsable d'opération" - -#: furnitures/forms.py:1094 furnitures/models.py:337 furnitures/models.py:355 +#: furnitures/forms.py:1074 furnitures/forms.py:1115 furnitures/models.py:338 +#: furnitures/models.py:356 msgid "Operation type" msgstr "Type d'opération" -#: furnitures/forms.py:1096 furnitures/models.py:346 furnitures/models.py:414 -#: furnitures/models.py:437 furnitures/models.py:553 furnitures/models.py:699 -#: furnitures/models.py:738 +#: furnitures/forms.py:1090 +msgid "You should select an operation." +msgstr "Vous devez sélectionner une opération." + +#: furnitures/forms.py:1106 furnitures/models.py:603 +msgid "Person in charge of the operation" +msgstr "Responsable d'opération" + +#: furnitures/forms.py:1117 furnitures/models.py:347 furnitures/models.py:415 +#: furnitures/models.py:438 furnitures/models.py:554 furnitures/models.py:708 +#: furnitures/models.py:747 msgid "Start date" msgstr "Date de début" -#: furnitures/forms.py:1106 +#: furnitures/forms.py:1127 msgid "References" msgstr "Référence" -#: furnitures/forms.py:1116 +#: furnitures/forms.py:1137 msgid "Code DRACAR" msgstr "Code DRACAR" -#: furnitures/forms.py:1127 +#: furnitures/forms.py:1148 #, python-format msgid "" "Operation code already exist for year: %(year)d - use a value bigger than " @@ -317,27 +323,27 @@ msgstr "" "Ce code d'opération existe déjà pour l'année %(year)d - utilisez une valeur " "plus grande que %(last_val)d" -#: furnitures/forms.py:1161 furnitures/forms.py:1186 furnitures/models.py:343 +#: furnitures/forms.py:1182 furnitures/forms.py:1207 furnitures/models.py:344 msgid "Remain types" msgstr "Types de vestige" -#: furnitures/forms.py:1163 furnitures/models.py:342 +#: furnitures/forms.py:1184 furnitures/models.py:343 msgid "Remain type" msgstr "Type de vestige" -#: furnitures/forms.py:1181 +#: furnitures/forms.py:1202 msgid "There are identical remain types." msgstr "Il y a des types de vestige identiques." -#: furnitures/forms.py:1206 furnitures/forms.py:1207 furnitures/models.py:347 +#: furnitures/forms.py:1227 furnitures/forms.py:1228 furnitures/models.py:348 msgid "Closing date" msgstr "Date de clotûre" -#: furnitures/forms.py:1217 +#: furnitures/forms.py:1238 msgid "Would you like to close this operation?" msgstr "Voulez vous clôturer cette opération ?" -#: furnitures/forms.py:1235 +#: furnitures/forms.py:1256 msgid "Would you like to delete this operation?" msgstr "Voulez vous supprimer cette opération ?" @@ -405,8 +411,8 @@ msgstr "Élément invalide." msgid "This item already exist." msgstr "Cet élément existe déjà." -#: furnitures/models.py:108 furnitures/models.py:146 furnitures/models.py:448 -#: furnitures/models.py:499 furnitures/models.py:523 +#: furnitures/models.py:108 furnitures/models.py:146 furnitures/models.py:449 +#: furnitures/models.py:500 furnitures/models.py:524 msgid "Label" msgstr "Libellé" @@ -434,600 +440,600 @@ msgstr "Département" msgid "Departements" msgstr "Départements" -#: furnitures/models.py:158 +#: furnitures/models.py:159 msgid "Address complement" msgstr "Complément d'adresse" -#: furnitures/models.py:160 +#: furnitures/models.py:161 msgid "Postal code" msgstr "Code postal" -#: furnitures/models.py:163 +#: furnitures/models.py:164 msgid "Country" msgstr "Pays" -#: furnitures/models.py:165 +#: furnitures/models.py:166 msgid "Phone" msgstr "Téléphone" -#: furnitures/models.py:166 +#: furnitures/models.py:167 msgid "Mobile phone" msgstr "Téléphone portable" -#: furnitures/models.py:175 +#: furnitures/models.py:176 msgid "Organization type" msgstr "Type d'organisation" -#: furnitures/models.py:176 +#: furnitures/models.py:177 msgid "Organization types" msgstr "Types d'organisation" -#: furnitures/models.py:181 furnitures/models.py:211 furnitures/models.py:480 +#: furnitures/models.py:182 furnitures/models.py:212 furnitures/models.py:481 msgid "Type" msgstr "Type" -#: furnitures/models.py:184 +#: furnitures/models.py:185 msgid "Organization" msgstr "Organisation" -#: furnitures/models.py:185 +#: furnitures/models.py:186 msgid "Organizations" msgstr "Organisations" -#: furnitures/models.py:187 +#: furnitures/models.py:188 msgid "Can view own Organization" msgstr "Peut voir sa propre Organisation" -#: furnitures/models.py:188 +#: furnitures/models.py:189 msgid "Can add own Organization" msgstr "Peut ajouter sa propre Organisation" -#: furnitures/models.py:189 +#: furnitures/models.py:190 msgid "Can change own Organization" msgstr "Peut changer sa propre Organisation" -#: furnitures/models.py:190 +#: furnitures/models.py:191 msgid "Can delete own Organization" msgstr "Peut supprimer sa propre Organisation" -#: furnitures/models.py:199 +#: furnitures/models.py:200 msgid "Person types" msgstr "Types d'individu" -#: furnitures/models.py:202 +#: furnitures/models.py:203 msgid "Mr" msgstr "M" -#: furnitures/models.py:203 +#: furnitures/models.py:204 msgid "Miss" msgstr "Mlle" -#: furnitures/models.py:204 +#: furnitures/models.py:205 msgid "Mrs" msgstr "Mme" -#: furnitures/models.py:205 +#: furnitures/models.py:206 msgid "Doctor" msgstr "Dr" -#: furnitures/models.py:213 +#: furnitures/models.py:214 msgid "Is attached to" msgstr "Est rattaché à" -#: furnitures/models.py:221 +#: furnitures/models.py:222 msgid "Persons" msgstr "Individus" -#: furnitures/models.py:223 +#: furnitures/models.py:224 msgid "Can view Person" msgstr "Peut voir les Personnes" -#: furnitures/models.py:224 +#: furnitures/models.py:225 msgid "Can view own Person" msgstr "Peut voir sa propre Personne" -#: furnitures/models.py:225 +#: furnitures/models.py:226 msgid "Can add own Person" msgstr "Peut ajouter sa propre Personne" -#: furnitures/models.py:226 +#: furnitures/models.py:227 msgid "Can change own Person" msgstr "Peut changer sa propre Personne" -#: furnitures/models.py:227 +#: furnitures/models.py:228 msgid "Can delete own Person" msgstr "Peut supprimer sa propre Personne" -#: furnitures/models.py:242 +#: furnitures/models.py:243 msgid "Ishtar user" msgstr "Utilisateur d'Ishtar" -#: furnitures/models.py:243 +#: furnitures/models.py:244 msgid "Ishtar users" msgstr "Utilisateurs d'Ishtar" -#: furnitures/models.py:248 +#: furnitures/models.py:249 msgid "Archaeological file type" msgstr "Type de dossier archéologique" -#: furnitures/models.py:249 +#: furnitures/models.py:250 msgid "Archaeological file types" msgstr "Types de dossier archéologique" -#: furnitures/models.py:262 +#: furnitures/models.py:263 msgid "Permit types" msgstr "Types de permis" -#: furnitures/models.py:266 +#: furnitures/models.py:267 msgid "Delay (in days)" msgstr "Delai (en jours)" -#: furnitures/models.py:288 +#: furnitures/models.py:289 msgid "Is active?" msgstr "Est actif ?" -#: furnitures/models.py:297 +#: furnitures/models.py:298 msgid "Reference number" msgstr "Référence" -#: furnitures/models.py:311 +#: furnitures/models.py:312 msgid "Archaeological file" msgstr "Dossier archéologique" -#: furnitures/models.py:312 +#: furnitures/models.py:313 msgid "Archaeological files" msgstr "Dossiers archéologiques" -#: furnitures/models.py:314 +#: furnitures/models.py:315 msgid "Can view own Archaelogical file" msgstr "Peut voir son propre Dossier archéologique" -#: furnitures/models.py:315 +#: furnitures/models.py:316 msgid "Can add own Archaelogical file" msgstr "Peut ajouter son propre Dossier archéologique" -#: furnitures/models.py:316 +#: furnitures/models.py:317 msgid "Can change own Archaelogical file" msgstr "Peut changer son propre Dossier archéologique" -#: furnitures/models.py:317 +#: furnitures/models.py:318 msgid "Can delete own Archaelogical file" msgstr "Peut supprimer son propre Dossier archéologique" -#: furnitures/models.py:322 furnitures/models.py:377 +#: furnitures/models.py:323 furnitures/models.py:378 msgid "Intercommunal" msgstr "Intercommunal" -#: furnitures/models.py:338 +#: furnitures/models.py:339 msgid "Operation types" msgstr "Types d'opération" -#: furnitures/models.py:349 +#: furnitures/models.py:350 msgid "In charge" msgstr "Responsable" -#: furnitures/models.py:351 +#: furnitures/models.py:352 msgid "Operation code" msgstr "Code de l'opération" -#: furnitures/models.py:353 furnitures/models.py:394 +#: furnitures/models.py:354 furnitures/models.py:395 msgid "File" msgstr "Dossier" -#: furnitures/models.py:356 +#: furnitures/models.py:357 msgid "Remains" msgstr "Vestiges" -#: furnitures/models.py:368 +#: furnitures/models.py:369 msgid "Operations" msgstr "Opérations" -#: furnitures/models.py:370 +#: furnitures/models.py:371 msgid "Can view own Operation" msgstr "Peut voir sa propre Opération" -#: furnitures/models.py:371 +#: furnitures/models.py:372 msgid "Can add own Operation" msgstr "Peut ajouter sa propre Opération" -#: furnitures/models.py:372 +#: furnitures/models.py:373 msgid "Can change own Operation" msgstr "Peut changer sa propre Opération" -#: furnitures/models.py:373 +#: furnitures/models.py:374 msgid "Can delete own Operation" msgstr "Peut supprimer sa propre Opération" -#: furnitures/models.py:404 furnitures/models.py:447 furnitures/models.py:552 +#: furnitures/models.py:405 furnitures/models.py:448 furnitures/models.py:553 msgid "Parcel" msgstr "Parcelle" -#: furnitures/models.py:413 furnitures/models.py:522 +#: furnitures/models.py:414 furnitures/models.py:523 msgid "Order" msgstr "Ordre" -#: furnitures/models.py:415 furnitures/models.py:438 furnitures/models.py:554 -#: furnitures/models.py:700 furnitures/models.py:739 +#: furnitures/models.py:416 furnitures/models.py:439 furnitures/models.py:555 +#: furnitures/models.py:709 furnitures/models.py:748 msgid "End date" msgstr "Date de fin" -#: furnitures/models.py:416 +#: furnitures/models.py:417 msgid "Parent period" msgstr "Période parente" -#: furnitures/models.py:419 +#: furnitures/models.py:420 msgid "Type Period" msgstr "Type de période" -#: furnitures/models.py:420 +#: furnitures/models.py:421 msgid "Types Period" msgstr "Types de période" -#: furnitures/models.py:427 furnitures/models.py:439 +#: furnitures/models.py:428 furnitures/models.py:440 msgid "Dating type" msgstr "Type de datation" -#: furnitures/models.py:428 +#: furnitures/models.py:429 msgid "Dating types" msgstr "Types de datation" -#: furnitures/models.py:432 +#: furnitures/models.py:433 msgid "Dating quality" msgstr "Qualité de datation" -#: furnitures/models.py:433 +#: furnitures/models.py:434 msgid "Dating qualities" msgstr "Qualités de datation" -#: furnitures/models.py:436 +#: furnitures/models.py:437 msgid "Period" msgstr "Période" -#: furnitures/models.py:440 +#: furnitures/models.py:441 msgid "Quality" msgstr "Qualité" -#: furnitures/models.py:443 furnitures/models.py:534 +#: furnitures/models.py:444 furnitures/models.py:535 msgid "Dating" msgstr "Datation" -#: furnitures/models.py:444 +#: furnitures/models.py:445 msgid "Datings" msgstr "Datations" -#: furnitures/models.py:449 furnitures/models.py:500 furnitures/models.py:524 +#: furnitures/models.py:450 furnitures/models.py:501 furnitures/models.py:525 msgid "Description" msgstr "Description" -#: furnitures/models.py:450 furnitures/models.py:633 +#: furnitures/models.py:451 furnitures/models.py:634 msgid "Lenght" msgstr "Longueur" -#: furnitures/models.py:451 furnitures/models.py:634 +#: furnitures/models.py:452 furnitures/models.py:635 msgid "Width" msgstr "Largeur" -#: furnitures/models.py:452 +#: furnitures/models.py:453 msgid "Thickness" msgstr "Épaisseur" -#: furnitures/models.py:453 +#: furnitures/models.py:454 msgid "Depth" msgstr "Profondeur" -#: furnitures/models.py:455 +#: furnitures/models.py:456 msgid "Interpretation" msgstr "Interpretation" -#: furnitures/models.py:456 +#: furnitures/models.py:457 msgid "Filling" msgstr "Remplissage" -#: furnitures/models.py:461 furnitures/models.py:502 +#: furnitures/models.py:462 furnitures/models.py:503 msgid "Registration Unit" msgstr "Unité d'Enregistrement" -#: furnitures/models.py:462 +#: furnitures/models.py:463 msgid "Registration Units" msgstr "Unités d'Enregistrement" -#: furnitures/models.py:464 +#: furnitures/models.py:465 msgid "Can view own Registration Unit" msgstr "Peut voir sa propre Unité d'Enregistrement" -#: furnitures/models.py:465 +#: furnitures/models.py:466 msgid "Can add own Registration Unit" msgstr "Peut ajouter sa propre Unité d'Enregistrement" -#: furnitures/models.py:466 +#: furnitures/models.py:467 msgid "Can change own Registration Unit" msgstr "Peut changer sa propre Unité d'Enregistrement" -#: furnitures/models.py:467 +#: furnitures/models.py:468 msgid "Can delete own Registration Unit" msgstr "Peut supprimer sa propre Unité d'Enregistrement" -#: furnitures/models.py:475 +#: furnitures/models.py:476 msgid "Source type" msgstr "Type de source" -#: furnitures/models.py:476 +#: furnitures/models.py:477 msgid "Source types" msgstr "Types de source" -#: furnitures/models.py:483 furnitures/models.py:723 +#: furnitures/models.py:484 furnitures/models.py:732 msgid "Source" msgstr "Source" -#: furnitures/models.py:484 +#: furnitures/models.py:485 msgid "Sources" msgstr "Sources" -#: furnitures/models.py:490 +#: furnitures/models.py:491 msgid "Recommendation" msgstr "Recommendation" -#: furnitures/models.py:492 +#: furnitures/models.py:493 msgid "Parent material" msgstr "Matériau parent" -#: furnitures/models.py:495 furnitures/models.py:526 +#: furnitures/models.py:496 furnitures/models.py:527 msgid "Material type" msgstr "Type de matériaux" -#: furnitures/models.py:496 +#: furnitures/models.py:497 msgid "Material types" msgstr "Types de matériaux" -#: furnitures/models.py:503 +#: furnitures/models.py:504 msgid "Is isolated?" msgstr "Est isolé ?" -#: furnitures/models.py:508 furnitures/models.py:521 +#: furnitures/models.py:509 furnitures/models.py:522 msgid "Base item" msgstr "Élément de base" -#: furnitures/models.py:509 +#: furnitures/models.py:510 msgid "Base items" msgstr "Éléments de base" -#: furnitures/models.py:511 +#: furnitures/models.py:512 msgid "Can view own Base item" msgstr "Peut voir son propre Élément de base" -#: furnitures/models.py:512 +#: furnitures/models.py:513 msgid "Can add own Base item" msgstr "Peut ajouter son propre Élément de base" -#: furnitures/models.py:513 +#: furnitures/models.py:514 msgid "Can change own Base item" msgstr "Peut changer son propre Élément de base" -#: furnitures/models.py:514 +#: furnitures/models.py:515 msgid "Can delete own Base item" msgstr "Peut supprimer son propre Élément de base" -#: furnitures/models.py:527 furnitures/models.py:636 +#: furnitures/models.py:528 furnitures/models.py:637 msgid "Volume" msgstr "Volume" -#: furnitures/models.py:528 +#: furnitures/models.py:529 msgid "Weight" msgstr "Poids" -#: furnitures/models.py:529 +#: furnitures/models.py:530 msgid "Item number" msgstr "Nombre d'éléments" -#: furnitures/models.py:531 +#: furnitures/models.py:532 msgid "Upstream treatment" msgstr "Traitement amont" -#: furnitures/models.py:533 +#: furnitures/models.py:534 msgid "Downstream treatment" msgstr "Traitement aval" -#: furnitures/models.py:538 furnitures/models.py:734 +#: furnitures/models.py:539 furnitures/models.py:743 msgid "Item" msgstr "Élément" -#: furnitures/models.py:539 +#: furnitures/models.py:540 msgid "Items" msgstr "Éléments" -#: furnitures/models.py:541 +#: furnitures/models.py:542 msgid "Can view own Item" msgstr "Peut voir son propre Élément" -#: furnitures/models.py:542 +#: furnitures/models.py:543 msgid "Can add own Item" msgstr "Peut ajouter son propre Élément" -#: furnitures/models.py:543 +#: furnitures/models.py:544 msgid "Can change own Item" msgstr "Peut changer son propre Élément" -#: furnitures/models.py:544 +#: furnitures/models.py:545 msgid "Can delete own Item" msgstr "Peut supprimer son propre Élément" -#: furnitures/models.py:551 +#: furnitures/models.py:552 msgid "Owner" msgstr "Propriétaire" -#: furnitures/models.py:557 +#: furnitures/models.py:558 msgid "Parcel owner" msgstr "Propriétaire de parcelle" -#: furnitures/models.py:558 +#: furnitures/models.py:559 msgid "Parcel owners" msgstr "Propriétaires de parcelle" -#: furnitures/models.py:565 furnitures/models.py:571 +#: furnitures/models.py:566 furnitures/models.py:572 msgid "Warehouse type" msgstr "Type de dépôt" -#: furnitures/models.py:566 +#: furnitures/models.py:567 msgid "Warehouse types" msgstr "Types de dépôts" -#: furnitures/models.py:577 +#: furnitures/models.py:578 msgid "Warehouse" msgstr "Dépôt" -#: furnitures/models.py:578 +#: furnitures/models.py:579 msgid "Warehouses" msgstr "Dépôts" -#: furnitures/models.py:580 +#: furnitures/models.py:581 msgid "Can view own Warehouse" msgstr "Peut voir son propre Dépôt" -#: furnitures/models.py:581 +#: furnitures/models.py:582 msgid "Can add own Warehouse" msgstr "Peut ajouter son propre Dépôt" -#: furnitures/models.py:582 +#: furnitures/models.py:583 msgid "Can change own Warehouse" msgstr "Peut changer son propre Dépôt" -#: furnitures/models.py:583 +#: furnitures/models.py:584 msgid "Can delete own Warehouse" msgstr "Peut supprimer son propre Dépôt" -#: furnitures/models.py:593 +#: furnitures/models.py:594 msgid "Intended to" msgstr "Destiné à" -#: furnitures/models.py:597 +#: furnitures/models.py:598 msgid "Act types" msgstr "Types d'acte" -#: furnitures/models.py:604 +#: furnitures/models.py:605 msgid "Archaeological preventive operator" msgstr "Opérateur d'archéologie préventive" -#: furnitures/models.py:606 +#: furnitures/models.py:607 msgid "Person in charge of the scientific part" msgstr "Responsable scientifique" -#: furnitures/models.py:621 +#: furnitures/models.py:622 msgid "Administrative acts" msgstr "Actes administratifs" -#: furnitures/models.py:623 +#: furnitures/models.py:624 msgid "Can view own Administrative act" msgstr "Peut voir son propre Acte administratif" -#: furnitures/models.py:624 +#: furnitures/models.py:625 msgid "Can add own Administrative act" msgstr "Peut ajouter son propre Acte administratif" -#: furnitures/models.py:625 +#: furnitures/models.py:626 msgid "Can change own Administrative act" msgstr "Peut changer son propre Acte administratif" -#: furnitures/models.py:626 +#: furnitures/models.py:627 msgid "Can delete own Administrative act" msgstr "Peut supprimer son propre Acte administratif" -#: furnitures/models.py:635 +#: furnitures/models.py:636 msgid "Height" msgstr "Hauteur" -#: furnitures/models.py:637 furnitures/models.py:644 furnitures/models.py:648 +#: furnitures/models.py:638 furnitures/models.py:645 furnitures/models.py:649 msgid "Reference" msgstr "Référence" -#: furnitures/models.py:640 furnitures/models.py:647 +#: furnitures/models.py:641 furnitures/models.py:648 msgid "Container type" msgstr "Type de contenant" -#: furnitures/models.py:641 +#: furnitures/models.py:642 msgid "Container types" msgstr "Types de contenant" -#: furnitures/models.py:645 furnitures/models.py:697 +#: furnitures/models.py:646 furnitures/models.py:706 msgid "Location" msgstr "Lieu" -#: furnitures/models.py:652 furnitures/models.py:694 +#: furnitures/models.py:653 furnitures/models.py:703 msgid "Container" msgstr "Contenant" -#: furnitures/models.py:653 +#: furnitures/models.py:654 msgid "Containers" msgstr "Contenants" -#: furnitures/models.py:672 +#: furnitures/models.py:673 msgid "Surface" msgstr "Surface" -#: furnitures/models.py:673 +#: furnitures/models.py:674 msgid "Localisation" msgstr "Localisation" -#: furnitures/models.py:688 +#: furnitures/models.py:697 msgid "Virtual" msgstr "Virtuel" -#: furnitures/models.py:690 furnitures/models.py:696 +#: furnitures/models.py:699 furnitures/models.py:705 msgid "Treatment type" msgstr "Type de traitement" -#: furnitures/models.py:691 +#: furnitures/models.py:700 msgid "Treatment types" msgstr "Types de traitements" -#: furnitures/models.py:704 +#: furnitures/models.py:713 msgid "Treatment" msgstr "Traitement" -#: furnitures/models.py:705 +#: furnitures/models.py:714 msgid "Treatments" msgstr "Traitements" -#: furnitures/models.py:707 +#: furnitures/models.py:716 msgid "Can view own Treatment" msgstr "Peut voir son propre Traitement" -#: furnitures/models.py:708 +#: furnitures/models.py:717 msgid "Can add own Treatment" msgstr "Peut ajouter son propre Traitement" -#: furnitures/models.py:709 +#: furnitures/models.py:718 msgid "Can change own Treatment" msgstr "Peut changer son propre Traitement" -#: furnitures/models.py:710 +#: furnitures/models.py:719 msgid "Can delete own Treatment" msgstr "Peut supprimer son propre traitement" -#: furnitures/models.py:718 furnitures/models.py:724 +#: furnitures/models.py:727 furnitures/models.py:733 msgid "Author type" msgstr "Type d'auteur" -#: furnitures/models.py:719 +#: furnitures/models.py:728 msgid "Author types" msgstr "Types d'auteur" -#: furnitures/models.py:727 +#: furnitures/models.py:736 msgid "Author" msgstr "Auteur" -#: furnitures/models.py:728 +#: furnitures/models.py:737 msgid "Authors" msgstr "Auteurs" -#: furnitures/models.py:742 +#: furnitures/models.py:751 msgid "Property" msgstr "Propriété" -#: furnitures/models.py:743 +#: furnitures/models.py:752 msgid "Properties" msgstr "Propriétés" -#: furnitures/views.py:171 +#: furnitures/views.py:218 msgid "Operation not permitted." msgstr "Opération non permise" @@ -1035,25 +1041,41 @@ msgstr "Opération non permise" msgid "Delete" msgstr "Supprimer" -#: templates/base.html:24 +#: furnitures/widgets.py:152 +msgid "Search" +msgstr "Recherche" + +#: furnitures/widgets.py:152 +msgid "Search and select an item" +msgstr "Rechercher puis sélectionner un élément" + +#: furnitures/widgets.py:217 +msgid "No results" +msgstr "Pas de résultats" + +#: furnitures/widgets.py:218 +msgid "Loading..." +msgstr "Chargement..." + +#: templates/base.html:26 msgid "Logged in" msgstr "Connecté" -#: templates/base.html:25 +#: templates/base.html:27 msgid "Log out" msgstr "Déconnexion" -#: templates/base.html:26 +#: templates/base.html:28 msgid "Change password" msgstr "Changement de mot de passe" -#: templates/base.html:28 templates/registration/activate.html:10 +#: templates/base.html:30 templates/registration/activate.html:10 #: templates/registration/login.html:8 templates/registration/login.html:10 #: templates/registration/password_reset_complete.html:8 msgid "Log in" msgstr "Connexion" -#: templates/base.html:39 +#: templates/base.html:41 msgid "Default items" msgstr "Éléments par défaut" @@ -1065,11 +1087,11 @@ msgstr "Vous avez entré les informations suivantes :" msgid "Would you like to save them?" msgstr "Voulez vous sauver ces informations ?" -#: templates/confirm_wizard.html:30 templates/default_wizard.html:29 +#: templates/confirm_wizard.html:30 templates/default_wizard.html:32 msgid "Validate" msgstr "Valider" -#: templates/default_wizard.html:20 +#: templates/default_wizard.html:23 msgid "Add/Modify" msgstr "Ajouter-Modifier" diff --git a/ishtar/scripts/__init__.py b/ishtar/scripts/__init__.py new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/ishtar/scripts/__init__.py diff --git a/ishtar/scripts/import_from_csv.py b/ishtar/scripts/import_from_csv.py new file mode 100755 index 000000000..7eb655641 --- /dev/null +++ b/ishtar/scripts/import_from_csv.py @@ -0,0 +1,68 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +""" +Import departements and towns from csv file +""" + +DELIMITER = "," +QUOTECHAR = '"' + +import sys +import csv +sys.path.append('.') + +from django.core.management import setup_environ +import settings + +setup_environ(settings) + +from optparse import OptionParser + +from furnitures import models + +def insert_department(value): + idx, label = value + if models.Departement.objects.filter(number=idx).count(): + return + models.Departement(number=idx, label=label).save() + print idx, label, u" inserted" + +def insert_town(value): + idx, label = value + if models.Town.objects.filter(numero_insee=idx).count(): + return + try: + dpt = models.Departement.objects.get(number=idx[:2]) + except: + return + models.Town(numero_insee=idx, name=label, departement=dpt).save() + print idx, label, u" inserted" + +tables = {u"department":insert_department, + u"town":insert_town} + +usage = u"usage: %%prog csv_file.csv table_name\n\n"\ + u"Table name must be in: %s." % u", ".join(tables.keys()) +parser = OptionParser(usage=usage) + +(options, args) = parser.parse_args() + +try: + assert len(args) == 2 +except AssertionError: + parser.error(u"You must provide one csv file and the table name.") + +try: + assert args[1] in tables.keys() +except AssertionError: + parser.error(u"Incorrect table name.") + +try: + values = csv.reader(open(args[0], 'rb'), delimiter=DELIMITER, + quotechar=QUOTECHAR) +except (IOError): + parser.error(u"Incorrect CSV file.") + +for value in values: + tables[args[1]](value) diff --git a/ishtar/scripts/import_towns_from_osm.py b/ishtar/scripts/import_towns_from_osm.py new file mode 100755 index 000000000..6c5698b4b --- /dev/null +++ b/ishtar/scripts/import_towns_from_osm.py @@ -0,0 +1,110 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +""" +Import towns from OpenStreetMap data. +Take an OSM xml file for argument. + +To get an OSM file (with a bounding box adapted to your needs): +curl --location --globoff "http://www.informationfreeway.org/api/0.6/node[place=village|town|city][bbox=-5.53711,41.90228,8.96484,51.50874]" -o city.osm +or from a whole xml/pbf export: +./osmosis --read-pbf ~/france-20110125.osm.pbf --node-key-value keyValueList="place.village,place.town,place.city" --write-xml city.osm +""" + +import sys +sys.path.append('.') + +from django.core.management import setup_environ +from django.core.exceptions import ObjectDoesNotExist +from django.contrib.gis.geos import Point +import settings + +setup_environ(settings) + +from optparse import OptionParser +from xml.parsers import expat + +from furnitures import models + +usage = "usage: %prog osm_file.xml" +parser = OptionParser(usage=usage) + +(options, args) = parser.parse_args() + +try: + assert len(args) == 1 +except AssertionError: + parser.error("You must provide one XML file") + + +ATTRS = [u"lat", u"lon"] + +# key : (mandatory, [restraint to keys]) +TAGS = {u"place":(True, [u"village", u"town", u"city"]), + u"ref:INSEE":(True, []), + u"population":(False, []) + } + +class TownParser: + + def __init__(self): + self._parser = expat.ParserCreate() + self._parser.returns_unicode = True + self._parser.StartElementHandler = self.start + self._parser.EndElementHandler = self.end + self._parser.CharacterDataHandler = self.data + self.town = {} + self.number = 0 + + def feed(self, data): + self._parser.ParseFile(data) + + def close(self): + self._parser.Parse("", 1) # end of data + del self._parser # get rid of circular references + + def start(self, tag, attrs): + if tag == u"node": + self.town = {} + for attr in ATTRS: + if attr in attrs: + self.town[attr] = attrs[attr] + if tag == u"tag": + if not u"k" in attrs or not u"v" in attrs: + return + if attrs[u"k"] in TAGS: + limit = TAGS[attrs[u"k"]][1] + if limit and \ + (attrs[u"v"] not in limit or \ + (type(limit) == unicode and limit not in attrs[u"v"])): + self.town["DEL"] = True + return + self.town[attrs[u"k"]] = attrs[u"v"] + + def end(self, tag): + if tag == u"node" and self.town and "DEL" not in self.town: + for k in TAGS: + if TAGS[k][0] and k not in self.town: + return + self.number += 1 + try: + town = models.Town.objects.get(numero_insee=self.town["ref:INSEE"]) + except ObjectDoesNotExist: + return + town.center = Point(float(self.town['lon']), float(self.town['lat']), + srid=4326) + town.save() + print town, "updated" + + def data(self, data): + pass + +p = TownParser() + +try: + p.feed(file(args[0])) + print u"%d towns updated" % p.number +except (IOError, expat.ExpatError): + parser.error("Incorrect XML file") + + diff --git a/ishtar/settings.py.example b/ishtar/settings.py.example index 23554fff7..92ce2baa1 100644 --- a/ishtar/settings.py.example +++ b/ishtar/settings.py.example @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (C) 2010 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # Django settings for ishtar project. # Ishtar custom @@ -18,7 +21,7 @@ ADMINS = ( ) MANAGERS = ADMINS -AUTH_PROFILE_MODULE = 'furnitures.IshtarUser' +AUTH_PROFILE_MODULE = 'ishtar.furnitures.IshtarUser' DATABASES = { 'default': { @@ -104,7 +107,7 @@ TEMPLATE_DIRS = ( AUTHENTICATION_BACKENDS = ( 'django.contrib.auth.backends.ModelBackend', - 'furnitures.backend.ObjectOwnPermBackend', + 'ishtar.furnitures.backend.ObjectOwnPermBackend', ) INSTALLED_APPS = ( @@ -115,5 +118,6 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.admin', 'registration', + #'ishtar.scripts', 'ishtar.furnitures' ) diff --git a/ishtar/templates/base.html b/ishtar/templates/base.html index e726cf782..22e6d4239 100644 --- a/ishtar/templates/base.html +++ b/ishtar/templates/base.html @@ -16,6 +16,8 @@ <script language="javascript" type="text/javascript" src="{{JQUERY_UI_URL}}ui/i18n/jquery.ui.datepicker-{{COUNTRY}}.js"></script> <script language="javascript" type="text/javascript" src="{{MEDIA_URL}}/js/ishtar.js"></script> <link type="text/css" href="{{JQUERY_UI_URL}}css/smoothness/jquery-ui.css" rel="stylesheet" /> + {% block extra_head %} + {% endblock %} </head> <body> <div id="header"> diff --git a/ishtar/templates/confirm_wizard.html b/ishtar/templates/confirm_wizard.html index 5a92e0d58..371de39c3 100644 --- a/ishtar/templates/confirm_wizard.html +++ b/ishtar/templates/confirm_wizard.html @@ -15,7 +15,7 @@ <table class='confirm'> <caption>{{form_label}}</caption> {% for label, data, cls in form_data %} - <tr{%if cls%} class='{{cls}}'{%endif%}><th>{{label}}</th><td>{{data}}</td></th> + <tr{%if cls%} class='{{cls}}'{%endif%}><th>{{label}}</th><td>{{data}}</td></tr> {% endfor %} </table> {% endfor %} diff --git a/ishtar/templates/default_wizard.html b/ishtar/templates/default_wizard.html index ff1bc7975..1666b4979 100644 --- a/ishtar/templates/default_wizard.html +++ b/ishtar/templates/default_wizard.html @@ -1,6 +1,9 @@ {% extends "base.html" %} {% load i18n %} {% load range %} +{% block extra_head %} +{{form.media}} +{% endblock %} {% block content %} <form action="." method="post">{% csrf_token %} <ul id='form_path'> @@ -26,7 +29,7 @@ {% endif %} <input type="hidden" name="{{ step_field }}" value="{{ step0 }}" /> {{ previous_fields|safe }} -<input type="submit" value="{% trans "Validate" %}"/> +<input type="submit" id="submit_form" value="{% trans "Validate" %}"/> </div> </form> {% endblock %} diff --git a/ishtar/urls.py b/ishtar/urls.py index 40fefc196..43f11943a 100644 --- a/ishtar/urls.py +++ b/ishtar/urls.py @@ -1,7 +1,9 @@ from django.conf.urls.defaults import * +from django.contrib.auth.models import User from django.contrib import admin admin.autodiscover() +admin.site.unregister(User) from settings import URL_PATH |
