various improvements for lists
This commit is contained in:
parent
0eefc3dfd3
commit
31c1ee7fba
17 changed files with 636 additions and 317 deletions
|
|
@ -35,7 +35,7 @@ class List(models.Model):
|
|||
upload_to=lambda i, x: i.path("icon.jpg"))
|
||||
|
||||
view = models.TextField(default=settings.CONFIG['user']['ui']['listView'])
|
||||
sort = TupleField(default=tuple(settings.CONFIG['user']['ui']['listSort']), editable=False)
|
||||
sort = TupleField(default=settings.CONFIG['user']['ui']['listSort'], editable=False)
|
||||
|
||||
poster_frames = TupleField(default=[], editable=False)
|
||||
|
||||
|
|
|
|||
|
|
@ -238,6 +238,8 @@ def addList(request):
|
|||
list.view = data['view']
|
||||
if 'sort' in data:
|
||||
list.sort= tuple(data['sort'])
|
||||
if 'posterFrames' in data:
|
||||
list.poster_frames = tuple(data['posterFrames'])
|
||||
|
||||
list.save()
|
||||
|
||||
|
|
@ -245,6 +247,9 @@ def addList(request):
|
|||
for item in Item.objects.filter(itemId__in=data['items']):
|
||||
list.add(item)
|
||||
|
||||
if 'posterFrames' in data:
|
||||
list.update_icon()
|
||||
|
||||
if list.status == 'featured':
|
||||
pos, created = models.Position.objects.get_or_create(list=list,
|
||||
user=request.user, section='featured')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue