Send item 'pk' in tree JSON

This commit is contained in:
Oliver Walters 2019-05-09 22:42:43 +10:00
parent 92930766c6
commit 897c0b5261

View File

@ -40,6 +40,7 @@ class TreeSerializer(views.APIView):
def itemToJson(self, item):
data = {
'pk': item.id,
'text': item.name,
'href': item.get_absolute_url(),
'tags': [item.item_count],
@ -68,6 +69,7 @@ class TreeSerializer(views.APIView):
top_count += item.item_count
top = {
'pk': None,
'text': self.title,
'href': self.root_url,
'nodes': nodes,