def _handle_drag_drop_decks(self, sources: list[SidebarItem], target: SidebarItem) -> bool: deck_ids = [ DeckId(source.id) for source in sources if source.item_type == SidebarItemType.DECK ] if not deck_ids: return False new_parent = DeckId(target.id) reparent_decks(parent=self.browser, deck_ids=deck_ids, new_parent=new_parent).run_in_background() return True
def _handle_drag_and_drop(self, source: DeckId, target: DeckId) -> None: reparent_decks(parent=self.mw, deck_ids=[source], new_parent=target).run_in_background()