-
-
Notifications
You must be signed in to change notification settings - Fork 489
Feat/builtin models types #2590
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
Open
FallenDeity
wants to merge
16
commits into
typeddjango:master
Choose a base branch
from
FallenDeity:feat/builtin-models-types
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5a1dd9f
feat: Typehint inbuilt models and fields
FallenDeity 74eae06
Merge branch 'master' of https://github.com/FallenDeity/django-stubs
FallenDeity 937435f
feat: Add tests and support for gis models
FallenDeity 60aa790
fix: Resolve pr comments
FallenDeity c36ba71
Merge branch 'master' into feat/builtin-models-types
FallenDeity 9e04be7
feat: Add tests for inbuilt models
FallenDeity 5a34c13
Merge branch 'master' of https://github.com/FallenDeity/django-stubs …
FallenDeity 75396f7
feat: Update allowlists, type all model fields
FallenDeity 2d76dc5
lint: Fix mypy typing error
FallenDeity 2017cee
Merge branch 'master' into feat/builtin-models-types
FallenDeity 50dfc93
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9562656
feat: Update Fields to overload dunder
FallenDeity 652250e
fix: Fix base session model
FallenDeity b3116f4
fix: Bring fields stubs inline
FallenDeity 8c2b16c
feat: Update allowlist.txt
FallenDeity 5603e96
chore: Remove unused imports from tests
FallenDeity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,31 @@ | ||
from typing import ClassVar, type_check_only | ||
|
||
from django.contrib.sites.models import Site | ||
from django.db import models | ||
from django.db.models.expressions import Combinable | ||
from typing_extensions import Self | ||
|
||
# This is a model that only exists in Django's model registry and doesn't have any | ||
# class statement form. It's the through model between 'FlatPage' and 'Site'. | ||
@type_check_only | ||
class _FlatPage_sites(models.Model): | ||
objects: ClassVar[models.Manager[Self]] | ||
|
||
id: models.AutoField | ||
pk: models.AutoField | ||
site: models.ForeignKey[Site | Combinable, Site] | ||
site_id: int | ||
flatpage: models.ForeignKey[FlatPage | Combinable, FlatPage] | ||
flatpage_id: int | ||
|
||
class FlatPage(models.Model): | ||
id: models.AutoField | ||
pk: models.AutoField | ||
url: models.CharField | ||
title: models.CharField | ||
content: models.TextField | ||
enable_comments: models.BooleanField | ||
template_name: models.CharField | ||
registration_required: models.BooleanField | ||
sites: models.ManyToManyField[Site, Site] | ||
sites: models.ManyToManyField[Site, _FlatPage_sites] | ||
def get_absolute_url(self) -> str: ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.