unicode, key_type
This commit is contained in:
parent
7b54205574
commit
7745ec5c7f
2 changed files with 7 additions and 7 deletions
|
@ -34,8 +34,8 @@ def parseCondition(condition):
|
||||||
else:
|
else:
|
||||||
exclude = False
|
exclude = False
|
||||||
|
|
||||||
key_type = models.site_config['keys'].get(k, 'string')
|
key_type = models.site_config['keys'].get(k, {'type':'string'}).get('type')
|
||||||
return {
|
key_type = {
|
||||||
'title': 'string',
|
'title': 'string',
|
||||||
'person': 'string'
|
'person': 'string'
|
||||||
}.get(key_type, key_type)
|
}.get(key_type, key_type)
|
||||||
|
|
|
@ -522,11 +522,11 @@ class Item(models.Model):
|
||||||
s = ItemSort(item=self)
|
s = ItemSort(item=self)
|
||||||
|
|
||||||
def sortNames(values):
|
def sortNames(values):
|
||||||
sort_value = ''
|
sort_value = u''
|
||||||
if values:
|
if values:
|
||||||
sort_value = '; '.join([get_name_sort(name) for name in values])
|
sort_value = u'; '.join([get_name_sort(name) for name in values])
|
||||||
if not sort_value:
|
if not sort_value:
|
||||||
sort_value = ''
|
sort_value = u''
|
||||||
return sort_value
|
return sort_value
|
||||||
|
|
||||||
base_keys = (
|
base_keys = (
|
||||||
|
@ -572,9 +572,9 @@ class Item(models.Model):
|
||||||
setattr(s, '%s_desc'%name, value)
|
setattr(s, '%s_desc'%name, value)
|
||||||
elif field_type == 'text':
|
elif field_type == 'text':
|
||||||
#FIXME: what use pural_key?
|
#FIXME: what use pural_key?
|
||||||
value = self.get(name, '')
|
value = self.get(name, u'')
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
value = ','.join(value)
|
value = u','.join(value)
|
||||||
value = unicodedata.normalize('NFKD', value)
|
value = unicodedata.normalize('NFKD', value)
|
||||||
setattr(s, name, value)
|
setattr(s, name, value)
|
||||||
if not value:
|
if not value:
|
||||||
|
|
Loading…
Reference in a new issue