feature lists
This commit is contained in:
parent
425679811b
commit
e9023227c0
2 changed files with 5 additions and 1 deletions
|
@ -17,6 +17,7 @@ class List(models.Model):
|
||||||
user = models.ForeignKey(User)
|
user = models.ForeignKey(User)
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
public = models.BooleanField(default=False)
|
public = models.BooleanField(default=False)
|
||||||
|
featured = models.BooleanField(default=False)
|
||||||
|
|
||||||
query = DictField(default={})
|
query = DictField(default={})
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,10 @@ def editList(request):
|
||||||
if list.editable(request.user):
|
if list.editable(request.user):
|
||||||
for key in data:
|
for key in data:
|
||||||
if key in ('name', 'public', 'query'):
|
if key in ('name', 'public', 'query'):
|
||||||
setattr(list, key, data['key'])
|
if key in data:
|
||||||
|
setattr(list, key, data[key])
|
||||||
|
if user.has_perm('Ox.admin') and 'featured' in data:
|
||||||
|
list.featured = data['featured']
|
||||||
else:
|
else:
|
||||||
response = json_response(status=403, text='not allowed')
|
response = json_response(status=403, text='not allowed')
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
|
|
Loading…
Reference in a new issue