{"action":"created","issue":{"url":"https://api.github.com/repos/xrmx/django-fancytree/issues/7","labels_url":"https://api.github.com/repos/xrmx/django-fancytree/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/xrmx/django-fancytree/issues/7/comments","events_url":"https://api.github.com/repos/xrmx/django-fancytree/issues/7/events","html_url":"https://github.com/xrmx/django-fancytree/issues/7","id":66455453,"number":7,"title":"can not show for checkboxes for saved nodes as checked in tree","user":{"login":"sertac","id":256038,"avatar_url":"https://avatars.githubusercontent.com/u/256038?v=3","gravatar_id":"","url":"https://api.github.com/users/sertac","html_url":"https://github.com/sertac","followers_url":"https://api.github.com/users/sertac/followers","following_url":"https://api.github.com/users/sertac/following{/other_user}","gists_url":"https://api.github.com/users/sertac/gists{/gist_id}","starred_url":"https://api.github.com/users/sertac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sertac/subscriptions","organizations_url":"https://api.github.com/users/sertac/orgs","repos_url":"https://api.github.com/users/sertac/repos","events_url":"https://api.github.com/users/sertac/events{/privacy}","received_events_url":"https://api.github.com/users/sertac/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-05T16:32:07Z","updated_at":"2015-04-07T21:46:25Z","closed_at":"2015-04-07T08:48:41Z","body":"django-fancytree saves checked nodes into db\r\nbut when it reads back from db it can not show checked nodes in tree"},"comment":{"url":"https://api.github.com/repos/xrmx/django-fancytree/issues/comments/90741315","html_url":"https://github.com/xrmx/django-fancytree/issues/7#issuecomment-90741315","issue_url":"https://api.github.com/repos/xrmx/django-fancytree/issues/7","id":90741315,"user":{"login":"sertac","id":256038,"avatar_url":"https://avatars.githubusercontent.com/u/256038?v=3","gravatar_id":"","url":"https://api.github.com/users/sertac","html_url":"https://github.com/sertac","followers_url":"https://api.github.com/users/sertac/followers","following_url":"https://api.github.com/users/sertac/following{/other_user}","gists_url":"https://api.github.com/users/sertac/gists{/gist_id}","starred_url":"https://api.github.com/users/sertac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sertac/subscriptions","organizations_url":"https://api.github.com/users/sertac/orgs","repos_url":"https://api.github.com/users/sertac/repos","events_url":"https://api.github.com/users/sertac/events{/privacy}","received_events_url":"https://api.github.com/users/sertac/received_events","type":"User","site_admin":false},"created_at":"2015-04-07T21:46:25Z","updated_at":"2015-04-07T21:46:25Z","body":"found my problem, now selected nodes ok on tree if we change select to selected\r\n\r\ndef get_doc(node, values):\r\n    if hasattr(node, \"get_doc\"):\r\n        return node.get_doc(values)\r\n    if hasattr(node, \"name\"):\r\n        name = node.name\r\n    else:\r\n        name = unicode(node)\r\n    doc = {\"title\": name, \"key\": node.pk}\r\n    if str(node.pk) in values:\r\n        doc['selected'] = True ######changed line select to selected#########\r\n        doc['expand'] = True\r\n    return doc\r\n\r\ndef recursive_node_to_dict(node, values):\r\n    result = get_doc(node, values)\r\n    children = [recursive_node_to_dict(c, values) for c in node.get_children()]\r\n    if children:\r\n        expand = [c for c in children if c.get('selected', False)] ####changed line select to selected#####\r\n        if expand:\r\n            result[\"expand\"] = True\r\n        result[\"folder\"] = True\r\n        result['children'] = children\r\n    return result"}}