Skip to content

Commit

Permalink
Add remove method for local storage models
Browse files Browse the repository at this point in the history
  • Loading branch information
laffra committed Nov 30, 2024
1 parent e0d04eb commit 96ea2c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ltk/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ def changed(self, name, value):
""" Called when an attribute of the model has changed """
if hasattr(self, "_key"):
self.__store.setItem(self._key, self.encode())

def remove(self):
""" Remove the model from local storage """
self.__store.removeItem(self._key)

@classmethod
def load(cls):
Expand Down

0 comments on commit 96ea2c8

Please sign in to comment.