Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add django stubs for HistoricForeignKey #1264

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading