django-authority/authority/exceptions.py

15 lines
388 B
Python
Raw Permalink Normal View History

class AuthorityException(Exception):
pass
class NotAModel(AuthorityException):
def __init__(self, object):
2020-02-07 09:50:47 +00:00
super(NotAModel, self).__init__("Not a model class or instance")
class UnsavedModelInstance(AuthorityException):
def __init__(self, object):
super(UnsavedModelInstance, self).__init__(
2020-02-07 09:50:47 +00:00
"Model instance has no pk, was it saved?"
)