improve relation_proxy types

This commit is contained in:
collerek
2021-03-19 17:13:59 +01:00
parent 929e979d37
commit 9c091afe35
6 changed files with 64 additions and 54 deletions

View File

@ -86,11 +86,6 @@ async def test_types() -> None:
reveal_type(publishers) # many to many
reveal_type(publishers[0]) # item in m2m list
# getting relation without __getattribute__
to_model = Publisher.Meta.model_fields['authors'].to
reveal_type(
publisher2._extract_related_model_instead_of_field("authors")
) # TODO: wrong
reveal_type(publisher.Meta.model_fields['authors'].to) # TODO: wrong
reveal_type(authors) # reverse many to many # TODO: wrong
reveal_type(book2) # queryset get
reveal_type(books) # queryset all