forked from 0x2620/pandora
merge
This commit is contained in:
parent
ca0f5c7e1e
commit
7c8e2a5765
1 changed files with 7 additions and 7 deletions
|
@ -624,7 +624,7 @@ class Item(models.Model):
|
||||||
elif key == 'name':
|
elif key == 'name':
|
||||||
values = []
|
values = []
|
||||||
for k in map(lambda x: x['id'],
|
for k in map(lambda x: x['id'],
|
||||||
filter(lambda x: x.get('sort') == 'person',
|
filter(lambda x: x.get('sortType') == 'person',
|
||||||
settings.CONFIG['itemKeys'])):
|
settings.CONFIG['itemKeys'])):
|
||||||
values += self.get(k, [])
|
values += self.get(k, [])
|
||||||
values = list(set(values))
|
values = list(set(values))
|
||||||
|
@ -692,10 +692,10 @@ class Item(models.Model):
|
||||||
'wordsperminute',
|
'wordsperminute',
|
||||||
)
|
)
|
||||||
|
|
||||||
for key in filter(lambda k: 'columnWidth' in k, settings.CONFIG['itemKeys']):
|
for key in filter(lambda k: k.get('sort', False), settings.CONFIG['itemKeys']):
|
||||||
name = key['id']
|
name = key['id']
|
||||||
source = name
|
source = name
|
||||||
sort_type = key.get('sort', key['type'])
|
sort_type = key.get('sortType', key['type'])
|
||||||
if 'value' in key:
|
if 'value' in key:
|
||||||
if 'layer' in key['value']:
|
if 'layer' in key['value']:
|
||||||
continue
|
continue
|
||||||
|
@ -845,7 +845,7 @@ class Item(models.Model):
|
||||||
current_values = []
|
current_values = []
|
||||||
#FIXME: is there a better way to build name collection?
|
#FIXME: is there a better way to build name collection?
|
||||||
for k in map(lambda x: x['id'],
|
for k in map(lambda x: x['id'],
|
||||||
filter(lambda x: x.get('sort') == 'person',
|
filter(lambda x: x.get('sortType') == 'person',
|
||||||
settings.CONFIG['itemKeys'])):
|
settings.CONFIG['itemKeys'])):
|
||||||
current_values += self.get(k, [])
|
current_values += self.get(k, [])
|
||||||
if not isinstance(current_values, list):
|
if not isinstance(current_values, list):
|
||||||
|
@ -1277,7 +1277,7 @@ for key in settings.CONFIG['itemKeys']:
|
||||||
|
|
||||||
Item.person_keys = []
|
Item.person_keys = []
|
||||||
for key in settings.CONFIG['itemKeys']:
|
for key in settings.CONFIG['itemKeys']:
|
||||||
if 'sort' in key and key['sort'] == 'person':
|
if key.get('sortType') == 'person':
|
||||||
Item.person_keys.append(key['id'])
|
Item.person_keys.append(key['id'])
|
||||||
|
|
||||||
class ItemFind(models.Model):
|
class ItemFind(models.Model):
|
||||||
|
@ -1308,10 +1308,10 @@ attrs = {
|
||||||
'height': models.BigIntegerField(null=True, blank=True, db_index=True),
|
'height': models.BigIntegerField(null=True, blank=True, db_index=True),
|
||||||
'created': models.DateTimeField(null=True, blank=True, db_index=True),
|
'created': models.DateTimeField(null=True, blank=True, db_index=True),
|
||||||
}
|
}
|
||||||
for key in filter(lambda k: 'columnWidth' in k or k['type'] in ('integer', 'time', 'float', 'date', 'enum'), settings.CONFIG['itemKeys']):
|
for key in filter(lambda k: k.get('sort', False) or k['type'] in ('integer', 'time', 'float', 'date', 'enum'), settings.CONFIG['itemKeys']):
|
||||||
name = key['id']
|
name = key['id']
|
||||||
name = {'id': 'itemId'}.get(name, name)
|
name = {'id': 'itemId'}.get(name, name)
|
||||||
sort_type = key.get('sort', key['type'])
|
sort_type = key.get('sortType', key['type'])
|
||||||
if isinstance(sort_type, list):
|
if isinstance(sort_type, list):
|
||||||
sort_type = sort_type[0]
|
sort_type = sort_type[0]
|
||||||
model = {
|
model = {
|
||||||
|
|
Loading…
Reference in a new issue