MCPcopy Index your code
hub / github.com/ormar-orm/ormar / remove

Method remove

ormar/relations/relation_manager.py:95–110  ·  view source on GitHub ↗

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"]]
    )

Source from the content-addressed store, hash-verified

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(

Callers 1

remove_parentMethod · 0.45

Calls 1

_getMethod · 0.95

Tested by

no test coverage detected