You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class BaseTreeNode(PolymorphicMPTTModel):
pass
class Edition(BaseTreeNode):
pass
class Chapter(BaseTreeNode):
pass
class ContentPage(BaseTreeNode):
pass
class Text(BaseTreeNode):
pass
When I move Chapter2 above Chapter1, all the actions of it's subnodes will become equal to the Chapter node. (While they should remain ContentPage-actions).
In other words, the tree will look like this:
- Edition1 [actions: add-chapter]
-- Chapter2 [actions: add-contentpage]
--- ContentPage2.1 [actions: add-contentpage] <---- this is not correct
-- Chapter1 [actions: add-contentpage]
--- ContentPage1.1 [actions: add-text]
--- ContentPage1.2 [actions: add-text]
The text was updated successfully, but these errors were encountered:
# Report back to client.
return HttpResponse(json.dumps({
'action': 'success',
'error': None,
'moved_id': moved_id,
'action_column': self.actions_column(moved),
}), content_type='application/json')
This should return a json for the node and all it's child-nodes. Instead of only the node itself.
Then the node + it's childnodes should be updated in the frontend in:
polymorphic_tree/templates/admin/polymorphic_tree/jstree_list_results.html
success: function onMoveSuccess(data, status, xhr) {
// Replace the action column, the preview URL changed.
if( data.action_column && data.moved_id == move_info.moved_node.id ) {
$(".col-actions_column", move_info.moved_node.element).html(data.action_column);
}
},
I just checked in the code, and the call to self.actions_column(moved) should be called with the polymorphic model. Can you verify what happens in your get_actions_column code? (e.g. with step through debugging). So far I can't see any obvious error in the the parentadmin.py code.
When I have the following PolymorphicTree:
The tree in the django-admin may look like this:
When I move Chapter2 above Chapter1, all the actions of it's subnodes will become equal to the Chapter node. (While they should remain ContentPage-actions).
In other words, the tree will look like this:
The text was updated successfully, but these errors were encountered: