forked from 0x2620/pandora
use / as list delimiter
This commit is contained in:
parent
c55a906bc9
commit
d39d66c112
3 changed files with 3 additions and 3 deletions
|
@ -83,7 +83,7 @@ def parseCondition(condition):
|
||||||
return q
|
return q
|
||||||
elif key_type == 'list':
|
elif key_type == 'list':
|
||||||
q = Q(itemId=False)
|
q = Q(itemId=False)
|
||||||
l = v.split(".")
|
l = v.split("/")
|
||||||
if len(l) == 2:
|
if len(l) == 2:
|
||||||
lqs = list(List.objects.filter(name=l[1], user__username=l[0]))
|
lqs = list(List.objects.filter(name=l[1], user__username=l[0]))
|
||||||
if len(lqs) == 1:
|
if len(lqs) == 1:
|
||||||
|
|
|
@ -64,7 +64,7 @@ class List(models.Model):
|
||||||
return self.get_id()
|
return self.get_id()
|
||||||
|
|
||||||
def get_id(self):
|
def get_id(self):
|
||||||
return u'%s.%s' % (self.user.username, self.name)
|
return u'%s/%s' % (self.user.username, self.name)
|
||||||
|
|
||||||
def editable(self, user):
|
def editable(self, user):
|
||||||
#FIXME: make permissions work
|
#FIXME: make permissions work
|
||||||
|
|
|
@ -13,7 +13,7 @@ from item import utils
|
||||||
from item.models import Item
|
from item.models import Item
|
||||||
|
|
||||||
def get_list_or_404_json(id):
|
def get_list_or_404_json(id):
|
||||||
username, listname = id.split('.')
|
username, listname = id.split('/')
|
||||||
return get_object_or_404_json(models.List, user__username=username, name=listname)
|
return get_object_or_404_json(models.List, user__username=username, name=listname)
|
||||||
|
|
||||||
def _order_query(qs, sort):
|
def _order_query(qs, sort):
|
||||||
|
|
Loading…
Reference in a new issue