diff options
author | yann <yann@yann-ubuntu.(none)> | 2011-03-05 11:19:01 +0100 |
---|---|---|
committer | yann <yann@yann-ubuntu.(none)> | 2011-03-05 11:19:01 +0100 |
commit | 9d00615db9fef6d4e0a5bc5cdf9bc9467f24f71c (patch) | |
tree | 3c2f41faff948a20ef3b90a3d6d472657f12579f | |
parent | ffaf0f1f7a6efc97377a6d9d81b60646c6388daa (diff) | |
parent | d17c126850f76984bde46b581a1ccf2c4b931441 (diff) | |
download | Ishtar-9d00615db9fef6d4e0a5bc5cdf9bc9467f24f71c.tar.bz2 Ishtar-9d00615db9fef6d4e0a5bc5cdf9bc9467f24f71c.zip |
Merge branch 'master' of ssh://lysithea.proxience.com/home/proxience/git/ishtar
-rw-r--r-- | ishtar/furnitures/views.py | 13 | ||||
-rw-r--r-- | ishtar/locale/fr/LC_MESSAGES/django.po | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/ishtar/furnitures/views.py b/ishtar/furnitures/views.py index 59faeca47..45de3e99c 100644 --- a/ishtar/furnitures/views.py +++ b/ishtar/furnitures/views.py @@ -37,7 +37,7 @@ from django.template.defaultfilters import slugify from django.shortcuts import render_to_response, redirect from django.utils.translation import ugettext, ugettext_lazy as _ from django.core.exceptions import ObjectDoesNotExist -from django.core.urlresolvers import reverse +from django.core.urlresolvers import reverse, NoReverseMatch from django.db.models import Q from django.core import serializers @@ -148,6 +148,8 @@ def get_item(model, func_name, default_name, extra_request_keys=[]): Generic treatment of tables """ def func(request, data_type='json', **dct): + if 'type' in dct: + data_type = dct.pop('type') if not data_type: data_type = 'json' fields = [model._meta.get_field_by_name(k)[0] @@ -200,9 +202,12 @@ def get_item(model, func_name, default_name, extra_request_keys=[]): if data_type == "json": rows = [] for data in datas: - res = {'id':data[0], - 'link':link_template % reverse('show-'+default_name, - args=[data[0], ''])} + try: + lnk = link_template % reverse('show-'+default_name, + args=[data[0], '']) + except NoReverseMatch: + lnk = '' + res = {'id':data[0], 'link':lnk} for idx, value in enumerate(data[1:]): if value: res[model.TABLE_COLS[idx].split('.')[-1]] = value diff --git a/ishtar/locale/fr/LC_MESSAGES/django.po b/ishtar/locale/fr/LC_MESSAGES/django.po index 10d132071..2c5276ad5 100644 --- a/ishtar/locale/fr/LC_MESSAGES/django.po +++ b/ishtar/locale/fr/LC_MESSAGES/django.po @@ -360,7 +360,7 @@ msgstr "Coût" #: furnitures/forms.py:1363 msgid "Preventive informations - diagnostic" -msgstr "Information archéologie préventive - diagnostique" +msgstr "Information archéologie préventive - diagnostic" #: furnitures/forms.py:1366 furnitures/models.py:418 msgid "Prescription on zoning" |