Removes given child from relation with given name. Since you can have many relations between two models you need to pass a name of relation from which you want to remove the child. :param name: name of the relation :type name: str :param child: child
(
self, name: str, child: Union["NewBaseModel", type["NewBaseModel"]]
)
| 93 | child_relation.add(parent) |
| 94 | |
| 95 | def remove( |
| 96 | self, name: str, child: Union["NewBaseModel", type["NewBaseModel"]] |
| 97 | ) -> None: |
| 98 | """ |
| 99 | Removes given child from relation with given name. |
| 100 | Since you can have many relations between two models you need to pass a name |
| 101 | of relation from which you want to remove the child. |
| 102 | |
| 103 | :param name: name of the relation |
| 104 | :type name: str |
| 105 | :param child: child to remove from relation |
| 106 | :type child: Union[Model, type[Model]] |
| 107 | """ |
| 108 | relation = self._get(name) |
| 109 | if relation: |
| 110 | relation.remove(child) |
| 111 | |
| 112 | @staticmethod |
| 113 | def remove_parent( |