-
Notifications
You must be signed in to change notification settings - Fork 1
/
stubs.py
46 lines (30 loc) · 905 Bytes
/
stubs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
from typing import Protocol, TypeVar
from uuid import UUID
from django.db import models
from django_audit_fields.stubs import AuditModelStub
class ModelMetaStub(Protocol):
verbose_name: str
verbose_name_plural: str
label_lower: str
object_name: str
app_label: str
model_name: str
def get_fields(self) -> list: ...
class BaseUuidModelStub(AuditModelStub, Protocol):
id: UUID
admin_url_name: str
admin_site_name: str
def get_absolute_url(self) -> str: ...
objects: models.Manager
_meta: ModelMetaStub
...
TBaseUuidModelStub = TypeVar("TBaseUuidModelStub", bound="BaseUuidModelStub")
class BaseUuidHistoryModelStub(AuditModelStub, Protocol):
id: UUID
admin_url_name: str
admin_site_name: str
def get_absolute_url(self) -> str: ...
objects: models.Manager
history: models.Manager
_meta: ModelMetaStub
...