feature lists

This commit is contained in:
j 2011-01-06 12:37:25 +05:30
parent 6eed38520d
commit 1506b51d28
2 changed files with 5 additions and 1 deletions

View file

@ -17,6 +17,7 @@ class List(models.Model):
user = models.ForeignKey(User)
name = models.CharField(max_length=255)
public = models.BooleanField(default=False)
featured = models.BooleanField(default=False)
query = DictField(default={})

View file

@ -103,7 +103,10 @@ def editList(request):
if list.editable(request.user):
for key in data:
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:
response = json_response(status=403, text='not allowed')
return render_to_json_response(response)