-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimizations #241
Optimizations #241
Conversation
…tion into serializers # Conflicts: # contentcuration/contentcuration/models.py # contentcuration/contentcuration/serializers.py # contentcuration/contentcuration/static/js/edit_channel/import/hbtemplates/import_list_item.handlebars # contentcuration/contentcuration/urls.py # contentcuration/contentcuration/views.py
…into serializers # Conflicts: # contentcuration/contentcuration/views.py
…ation into serializers # Conflicts: # contentcuration/contentcuration/models.py
…curation into serializers # Conflicts: # contentcuration/contentcuration/urls.py # contentcuration/contentcuration/view/file_views.py # contentcuration/contentcuration/view/node_views.py
@@ -377,29 +378,43 @@ class ContentNode(MPTTModel, models.Model): | |||
objects = TreeManager() | |||
|
|||
def get_original_node(self): | |||
|
|||
key = "original_channel_{}".format(self.original_source_node_id or self.pk) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
def get_channel(self): | ||
root = self.get_root() | ||
channel = root.channel_main or root.channel_trash or root.channel_language or root.channel_previous | ||
channel = root.channel_main or root.channel_trash or root.channel_staging or root.channel_previous | ||
if channel: | ||
return channel.first() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…curation into serializers # Conflicts: # contentcuration/contentcuration/static/js/edit_channel/move/views.js
return original_channel.main_tree.get_descendants().filter(node_id=self.original_source_node_id).first() or self | ||
|
||
return self.original_node or self | ||
original_node = original_channel.main_tree.get_descendants().filter(node_id=self.original_source_node_id).first() or self |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
return new_node | ||
|
||
def _duplicate_node(node, sort_order=None, parent=None, channel_id=None): |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Improves loading by 5x
Need to merge #238, #239, and #240 first
Includes following optimizations: