-
-
Notifications
You must be signed in to change notification settings - Fork 454
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.db.models.fields.related.ForeignObject
missing methods and attributes
#2154
Open
JaeHyuckSa
wants to merge
6
commits into
typeddjango:master
Choose a base branch
from
JaeHyuckSa:improve-related
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
6 commits
Select commit
Hold shift + click to select a range
3026dc8
Add typing of django.db.models.fields.related.ForeignObject
JaeHyuckSa 2b6b31a
Merge branch 'master' into improve-related
JaeHyuckSa dbd8b3d
Update allowlist_todo.txt
JaeHyuckSa c866156
Updated parts that required ClassVar
JaeHyuckSa 0a91481
Update the __copy__ method
JaeHyuckSa 33fa5b7
Merge branch 'master' into improve-related
JaeHyuckSa 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 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 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 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 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 |
---|---|---|
|
@@ -289,28 +289,13 @@ django.contrib.gis.db.models.FileField.formfield | |
django.contrib.gis.db.models.FilePathField.formfield | ||
django.contrib.gis.db.models.FloatField.formfield | ||
django.contrib.gis.db.models.ForeignKey.__class_getitem__ | ||
django.contrib.gis.db.models.ForeignKey.contribute_to_related_class | ||
django.contrib.gis.db.models.ForeignKey.convert_empty_strings | ||
django.contrib.gis.db.models.ForeignKey.descriptor_class | ||
django.contrib.gis.db.models.ForeignKey.formfield | ||
django.contrib.gis.db.models.ForeignKey.get_db_converters | ||
django.contrib.gis.db.models.ForeignObject.__copy__ | ||
django.contrib.gis.db.models.ForeignObject.__get__ | ||
django.contrib.gis.db.models.ForeignObject.contribute_to_related_class | ||
django.contrib.gis.db.models.ForeignObject.forward_related_accessor_class | ||
django.contrib.gis.db.models.ForeignObject.get_class_lookups | ||
django.contrib.gis.db.models.ForeignObject.get_extra_descriptor_filter | ||
django.contrib.gis.db.models.ForeignObject.get_extra_restriction | ||
django.contrib.gis.db.models.ForeignObject.get_foreign_related_value | ||
django.contrib.gis.db.models.ForeignObject.get_instance_value_for_fields | ||
django.contrib.gis.db.models.ForeignObject.get_joining_columns | ||
django.contrib.gis.db.models.ForeignObject.get_local_related_value | ||
django.contrib.gis.db.models.ForeignObject.get_path_info | ||
django.contrib.gis.db.models.ForeignObject.get_reverse_joining_columns | ||
django.contrib.gis.db.models.ForeignObject.get_reverse_path_info | ||
django.contrib.gis.db.models.ForeignObject.path_infos | ||
django.contrib.gis.db.models.ForeignObject.related_accessor_class | ||
django.contrib.gis.db.models.ForeignObject.requires_unique_target | ||
django.contrib.gis.db.models.ForeignObject.reverse_path_infos | ||
django.contrib.gis.db.models.ForeignObjectRel.__init__ | ||
django.contrib.gis.db.models.ForeignObjectRel.empty_strings_allowed | ||
|
@@ -354,8 +339,6 @@ django.contrib.gis.db.models.Model.add_to_class | |
django.contrib.gis.db.models.ObjectDoesNotExist | ||
django.contrib.gis.db.models.OneToOneField.__get__ | ||
django.contrib.gis.db.models.OneToOneField.formfield | ||
django.contrib.gis.db.models.OneToOneField.forward_related_accessor_class | ||
django.contrib.gis.db.models.OneToOneField.related_accessor_class | ||
django.contrib.gis.db.models.OneToOneRel.__init__ | ||
django.contrib.gis.db.models.OrderBy.as_oracle | ||
django.contrib.gis.db.models.OrderBy.as_sql | ||
|
@@ -724,28 +707,13 @@ django.db.models.FileField.formfield | |
django.db.models.FilePathField.formfield | ||
django.db.models.FloatField.formfield | ||
django.db.models.ForeignKey.__class_getitem__ | ||
django.db.models.ForeignKey.contribute_to_related_class | ||
django.db.models.ForeignKey.convert_empty_strings | ||
django.db.models.ForeignKey.descriptor_class | ||
django.db.models.ForeignKey.formfield | ||
django.db.models.ForeignKey.get_db_converters | ||
django.db.models.ForeignObject.__copy__ | ||
django.db.models.ForeignObject.__get__ | ||
django.db.models.ForeignObject.contribute_to_related_class | ||
django.db.models.ForeignObject.forward_related_accessor_class | ||
django.db.models.ForeignObject.get_class_lookups | ||
django.db.models.ForeignObject.get_extra_descriptor_filter | ||
django.db.models.ForeignObject.get_extra_restriction | ||
django.db.models.ForeignObject.get_foreign_related_value | ||
django.db.models.ForeignObject.get_instance_value_for_fields | ||
django.db.models.ForeignObject.get_joining_columns | ||
django.db.models.ForeignObject.get_local_related_value | ||
django.db.models.ForeignObject.get_path_info | ||
django.db.models.ForeignObject.get_reverse_joining_columns | ||
django.db.models.ForeignObject.get_reverse_path_info | ||
django.db.models.ForeignObject.path_infos | ||
django.db.models.ForeignObject.related_accessor_class | ||
django.db.models.ForeignObject.requires_unique_target | ||
django.db.models.ForeignObject.reverse_path_infos | ||
django.db.models.ForeignObjectRel.__init__ | ||
django.db.models.ForeignObjectRel.empty_strings_allowed | ||
|
@@ -787,8 +755,6 @@ django.db.models.Model.add_to_class | |
django.db.models.ObjectDoesNotExist | ||
django.db.models.OneToOneField.__get__ | ||
django.db.models.OneToOneField.formfield | ||
django.db.models.OneToOneField.forward_related_accessor_class | ||
django.db.models.OneToOneField.related_accessor_class | ||
django.db.models.OneToOneRel.__init__ | ||
django.db.models.OrderBy.as_oracle | ||
django.db.models.OrderBy.as_sql | ||
|
@@ -964,28 +930,13 @@ django.db.models.fields.json.KeyTransform.as_sqlite | |
django.db.models.fields.json.KeyTransformIsNull.as_sqlite | ||
django.db.models.fields.json.KeyTransformNumericLookupMixin.process_rhs | ||
django.db.models.fields.related.ForeignKey.__class_getitem__ | ||
django.db.models.fields.related.ForeignKey.contribute_to_related_class | ||
django.db.models.fields.related.ForeignKey.convert_empty_strings | ||
django.db.models.fields.related.ForeignKey.descriptor_class | ||
django.db.models.fields.related.ForeignKey.formfield | ||
django.db.models.fields.related.ForeignKey.get_db_converters | ||
django.db.models.fields.related.ForeignObject.__copy__ | ||
django.db.models.fields.related.ForeignObject.__get__ | ||
django.db.models.fields.related.ForeignObject.contribute_to_related_class | ||
django.db.models.fields.related.ForeignObject.forward_related_accessor_class | ||
django.db.models.fields.related.ForeignObject.get_class_lookups | ||
django.db.models.fields.related.ForeignObject.get_extra_descriptor_filter | ||
django.db.models.fields.related.ForeignObject.get_extra_restriction | ||
django.db.models.fields.related.ForeignObject.get_foreign_related_value | ||
django.db.models.fields.related.ForeignObject.get_instance_value_for_fields | ||
django.db.models.fields.related.ForeignObject.get_joining_columns | ||
django.db.models.fields.related.ForeignObject.get_local_related_value | ||
django.db.models.fields.related.ForeignObject.get_path_info | ||
django.db.models.fields.related.ForeignObject.get_reverse_joining_columns | ||
django.db.models.fields.related.ForeignObject.get_reverse_path_info | ||
django.db.models.fields.related.ForeignObject.path_infos | ||
django.db.models.fields.related.ForeignObject.related_accessor_class | ||
django.db.models.fields.related.ForeignObject.requires_unique_target | ||
django.db.models.fields.related.ForeignObject.get_extra_restriction | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have two questions:
error: not checking stubs due to mypy build errors:
django-stubs/contrib/contenttypes/fields.pyi:90: error: Signature of "get_extra_restriction" incompatible with supertype "ForeignObject" [override]
django-stubs/contrib/contenttypes/fields.pyi:90: note: Superclass:
django-stubs/contrib/contenttypes/fields.pyi:90: note: def get_extra_restriction(self, alias: str, related_alias: str) -> None
django-stubs/contrib/contenttypes/fields.pyi:90: note: Subclass:
django-stubs/contrib/contenttypes/fields.pyi:90: note: def get_extra_restriction(self, where_class: Type[WhereNode], alias: Optional[str], remote_alias: str) -> WhereNode
django-stubs/contrib/contenttypes/fields.pyi:92: error: Unused "type: ignore" comment [unused-ignore]
|
||
django.db.models.fields.related.ForeignObject.reverse_path_infos | ||
django.db.models.fields.related.ForeignObjectRel.__init__ | ||
django.db.models.fields.related.ForeignObjectRel.empty_strings_allowed | ||
|
@@ -1008,8 +959,6 @@ django.db.models.fields.related.ManyToOneRel.__init__ | |
django.db.models.fields.related.ManyToOneRel.identity | ||
django.db.models.fields.related.OneToOneField.__get__ | ||
django.db.models.fields.related.OneToOneField.formfield | ||
django.db.models.fields.related.OneToOneField.forward_related_accessor_class | ||
django.db.models.fields.related.OneToOneField.related_accessor_class | ||
django.db.models.fields.related.OneToOneRel.__init__ | ||
django.db.models.fields.related.RelatedField.formfield | ||
django.db.models.fields.related.lazy_related_operation | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this class has lots of unsolved problems. Let's solve them!
ClassVar
where needed: https://github.com/django/django/blob/a09082a9bec18f8e3ee8c10d473013ec67ffe93b/django/db/models/fields/related.py#L522-L530There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. As you suggested, I have handled all the relevant parts as class variables.