title refinement
This commit is contained in:
parent
04acc3c6f3
commit
2692300f3b
5 changed files with 19 additions and 10 deletions
|
|
@ -619,7 +619,7 @@ class Item(models.Model):
|
|||
if name not in base_keys:
|
||||
if sort_type == 'title':
|
||||
value = get_title_sort(self.get(source, u'Untitled'))
|
||||
value = utils.sort_string(value)[:955]
|
||||
value = utils.sort_title(value)[:955]
|
||||
set_value(s, name, value)
|
||||
elif sort_type == 'person':
|
||||
value = sortNames(self.get(source, []))
|
||||
|
|
|
|||
|
|
@ -201,14 +201,14 @@ def sort_string(string):
|
|||
|
||||
|
||||
def sort_title(title):
|
||||
#title
|
||||
title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title)
|
||||
|
||||
#title = title.replace(u'Æ', 'Ae')
|
||||
if isinstance(title, str):
|
||||
title = unicode(title)
|
||||
title = sort_string(title)
|
||||
|
||||
#title
|
||||
title = re.sub(u'[\'!¿¡,\.;\-"\:\*\[\]]', '', title)
|
||||
return title.strip()
|
||||
|
||||
def get_positions(ids, pos):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue