summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/forms.py2
-rw-r--r--ishtar_common/forms_common.py2
-rw-r--r--ishtar_common/models.py3
-rw-r--r--ishtar_common/widgets.py2
-rw-r--r--ishtar_common/wizards.py3
5 files changed, 9 insertions, 3 deletions
diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py
index cb007442e..4477213c9 100644
--- a/ishtar_common/forms.py
+++ b/ishtar_common/forms.py
@@ -59,7 +59,7 @@ import widgets
reverse_lazy = lazy(reverse, unicode)
-regexp_name = re.compile(r'^[\w\- ]+$', re.UNICODE)
+regexp_name = re.compile(r"^[,:/\w\-'\"() \&\[\]@]+$", re.UNICODE)
name_validator = validators.RegexValidator(regexp_name,
_(u"Enter a valid name consisting of letters, spaces and hyphens."), 'invalid')
diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py
index 52fcfc97a..5078ffaae 100644
--- a/ishtar_common/forms_common.py
+++ b/ishtar_common/forms_common.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2010-2011 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2010-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 Affero General Public License as
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index fd5bb5871..3e428999e 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -163,6 +163,9 @@ class GeneralType(models.Model):
def __unicode__(self):
return self.label
+ def short_label(self):
+ return self.label
+
@classmethod
def get_help(cls, dct={}, exclude=[]):
help_text = cls.HELP_TEXT
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py
index 06d6f20f0..3ecdad310 100644
--- a/ishtar_common/widgets.py
+++ b/ishtar_common/widgets.py
@@ -248,7 +248,7 @@ class JQueryJqGrid(forms.RadioSelect):
u"<div id='pager_%s'></div>\n"% (name, name)
encoding = settings.ENCODING or 'utf-8'
rendered += u"<div id='foot_%s' class='gridfooter'>\n" % name
- if unicode(self.source_full):
+ if unicode(self.source_full) and unicode(self.source_full) != 'None':
rendered += u"%s (%s) <a href='%scsv' target='_blank'>%s</a> - "\
u"<a href='%scsv' target='_blank'>%s</a>\n" % (
unicode(_("Export as CSV")), encoding, unicode(self.source),
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index e421c25dd..699c3a858 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -33,6 +33,7 @@ class Wizard(NamedUrlWizardView):
label = ''
modification = None # True when the wizard modify an item
storage_name = 'django.contrib.formtools.wizard.storage.session.SessionStorage'
+ translated_keys = ['title']
@staticmethod
def _check_right(step, condition=True):
@@ -203,6 +204,8 @@ class Wizard(NamedUrlWizardView):
value = cleaned_data[key]
if not value and value != False:
continue
+ if key in self.translated_keys:
+ value = _(value)
if type(value) == bool:
if value == True:
value = _(u"Yes")