Esempio n. 1
0
 def remove_model_item(self,
                       container,
                       name,
                       item,
                       *,
                       safe: bool = False) -> Changes.UndeleteLog:
     if self.container:
         return self.container.remove_model_item(container,
                                                 name,
                                                 item,
                                                 safe=safe)
     else:
         container.remove_item(name, item)
         return Changes.UndeleteLog()
Esempio n. 2
0
    def remove_model_item(self,
                          container,
                          name,
                          item,
                          *,
                          safe: bool = False) -> Changes.UndeleteLog:
        """Remove a model item. Let this item's container do it if possible; otherwise do it directly.

        Passing responsibility to this item's container allows the library to easily track dependencies.
        However, if this item isn't yet in the library hierarchy, then do the operation directly.
        """
        if self.container:
            return self.container.remove_model_item(container,
                                                    name,
                                                    item,
                                                    safe=safe)
        else:
            container.remove_item(name, item)
            return Changes.UndeleteLog()