We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd9aa52 commit b699a15Copy full SHA for b699a15
simple_history/models.py
@@ -3,6 +3,7 @@
3
import uuid
4
import warnings
5
from functools import partial
6
+from typing import TypeVar
7
8
from django.apps import apps
9
from django.conf import settings
@@ -45,6 +46,13 @@
45
46
except ImportError:
47
from threading import local as LocalContext
48
49
+
50
+# __set__ value type
51
+_ST = TypeVar("_ST")
52
+# __get__ return type
53
+_GT = TypeVar("_GT")
54
55
56
registered_models = {}
57
58
@@ -873,7 +881,7 @@ def get_queryset(self):
873
881
)
874
882
875
883
876
-class HistoricForeignKey(ForeignKey):
884
+class HistoricForeignKey(ForeignKey[_ST, _GT]):
877
885
"""
878
886
Allows foreign keys to work properly from a historic instance.
879
887
0 commit comments