Skip to content

Commit

Permalink
add django stubs for HistoricForeignKey
Browse files Browse the repository at this point in the history
  • Loading branch information
david-homelend committed Sep 28, 2023
1 parent fd9aa52 commit b699a15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion simple_history/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import uuid
import warnings
from functools import partial
from typing import TypeVar

from django.apps import apps
from django.conf import settings
Expand Down Expand Up @@ -45,6 +46,13 @@
except ImportError:
from threading import local as LocalContext


# __set__ value type
_ST = TypeVar("_ST")
# __get__ return type
_GT = TypeVar("_GT")


registered_models = {}


Expand Down Expand Up @@ -873,7 +881,7 @@ def get_queryset(self):
)


class HistoricForeignKey(ForeignKey):
class HistoricForeignKey(ForeignKey[_ST, _GT]):
"""
Allows foreign keys to work properly from a historic instance.
Expand Down

0 comments on commit b699a15

Please sign in to comment.