diff --git a/constance/backends/__init__.py b/constance/backends/__init__.py index 4aab112..3d5f8b6 100644 --- a/constance/backends/__init__.py +++ b/constance/backends/__init__.py @@ -1,39 +1,48 @@ """Defines the base constance backend.""" +from abc import ABC +from abc import abstractmethod -class Backend: + +class Backend(ABC): + @abstractmethod def get(self, key): """ Get the key from the backend store and return the value. Return None if not found. """ - raise NotImplementedError + ... + @abstractmethod async def aget(self, key): """ Get the key from the backend store and return the value. Return None if not found. """ - raise NotImplementedError + ... + @abstractmethod def mget(self, keys): """ Get the keys from the backend store and return a list of the values. Return an empty list if not found. """ - raise NotImplementedError + ... + @abstractmethod async def amget(self, keys): """ Get the keys from the backend store and return a list of the values. Return an empty list if not found. """ - raise NotImplementedError + ... + @abstractmethod def set(self, key, value): """Add the value to the backend store given the key.""" - raise NotImplementedError + ... + @abstractmethod async def aset(self, key, value): """Add the value to the backend store given the key.""" - raise NotImplementedError + ...