Commits

Gustavo Picon committed 4fa8a5e

pep8

Comments (0)

Files changed (4)

                     sib_order = 1
 
         if target.is_descendant_of(self):
-            raise InvalidMoveToDescendant(_("Can't move node to a descendant."))
+            raise InvalidMoveToDescendant(
+                    _("Can't move node to a descendant."))
 
         if self == target and (
-              (pos == 'left') or \
-              (pos in ('right', 'last-sibling') and \
-                target == target.get_last_sibling()) or \
-              (pos == 'first-sibling' and \
+              (pos == 'left') or
+              (pos in ('right', 'last-sibling') and
+                target == target.get_last_sibling()) or
+              (pos == 'first-sibling' and
                 target == target.get_first_sibling())):
             # special cases, not actually moving the node so no need to UPDATE
             return
             if 'children' in node_struct:
                 # extending the stack with the current node as the parent of
                 # the new nodes
-                stack.extend([(node_obj, node) \
-                    for node in node_struct['children'][::-1]])
+                stack.extend([
+                    (node_obj, node)
+                    for node in node_struct['children'][::-1]
+                ])
         transaction.commit_unless_managed()
         return added
 
             newobj.path = self._get_path(self.path, newobj.depth, 1)
             if len(newobj.path) > \
                     newobj.__class__._meta.get_field('path').max_length:
-                raise PathOverflow(_('The new node is too deep in the tree, try'
-                                   ' increasing the path.max_length property'
-                                   ' and UPDATE your database'))
+                raise PathOverflow(
+                        _('The new node is too deep in the tree, try'
+                          ' increasing the path.max_length property'
+                          ' and UPDATE your database'))
         # saving the instance before returning it
         newobj.save()
         newobj._cached_parent_obj = self
             target, target.depth)
 
         if target.is_descendant_of(self):
-            raise InvalidMoveToDescendant(_("Can't move node to a descendant."))
+            raise InvalidMoveToDescendant(
+                    _("Can't move node to a descendant."))
 
         if oldpath == target.path and (
-              (pos == 'left') or \
-              (pos in ('right', 'last-sibling') and \
-                target.path == target.get_last_sibling().path) or \
-              (pos == 'first-sibling' and \
+              (pos == 'left') or
+              (pos in ('right', 'last-sibling') and
+                target.path == target.get_last_sibling().path) or
+              (pos == 'first-sibling' and
                 target.path == target.get_first_sibling().path)):
             # special cases, not actually moving the node so no need to UPDATE
             return
                        'sorted-child': 'sorted-sibling'}[pos]
 
         if target.is_descendant_of(self):
-            raise InvalidMoveToDescendant(_("Can't move node to a descendant."))
+            raise InvalidMoveToDescendant(
+                    _("Can't move node to a descendant."))
 
         if self == target and (
-              (pos == 'left') or \
-              (pos in ('right', 'last-sibling') and \
-                target == target.get_last_sibling()) or \
-              (pos == 'first-sibling' and \
+              (pos == 'left') or
+              (pos in ('right', 'last-sibling') and
+                target == target.get_last_sibling()) or
+              (pos == 'first-sibling' and
                 target == target.get_first_sibling())):
             # special cases, not actually moving the node so no need to UPDATE
             return
             if 'children' in node_struct:
                 # extending the stack with the current node as the parent of
                 # the new nodes
-                stack.extend([(node_obj.pk, node) \
-                    for node in node_struct['children'][::-1]])
+                stack.extend([
+                    (node_obj.pk, node)
+                    for node in node_struct['children'][::-1]
+                ])
         transaction.commit_unless_managed()
         return added