-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
These methods need to be overridden, such that after they have called the implementation of the `Group` base class, the internal `_pseudos` class attribute can be updated accordingly. For `clear` this is easy as it is simply set to `None`, but for `remove_nodes` special care needs to be taken. It needs to account for the fact that a single node or an iterable of nodes can be passed as an argument, and that the base class implementation will not raise if any of the nodes is not actually contained in the group. So instead of doing the straight forward thing of removing the nodes from `_pseudos` based on the elements, we remove them based on the pk, which guarantees we are removing the correct nodes.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters