add DoesNotExist exception to Model

This commit is contained in:
Maxim Kurnikov
2018-09-26 17:05:42 +03:00
parent 8a0cad7c69
commit 7954c1bb90
2 changed files with 4 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ from typing import Any, Dict, List, Optional, Set, Tuple, Type, Union
from uuid import UUID
from django.core.checks.messages import Warning
from django.core.exceptions import ValidationError
from django.core.exceptions import ValidationError, ObjectDoesNotExist
from django.db.models.fields.related import ForeignKey
@@ -40,6 +40,9 @@ class ModelState:
fields_cache: Any = ...
class Model:
class DoesNotExist(ObjectDoesNotExist):
pass
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
@classmethod
def from_db(

View File

@@ -96,8 +96,6 @@ class QuerySet(Generic[_T]):
def as_manager(cls): ...
as_manager: Any = ...
def __deepcopy__(
self,
memo: Dict[