Skip to content

Instantly share code, notes, and snippets.

@jarshwah
Created December 21, 2022 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jarshwah/1e683416d2ed2df28f254fc787d0d304 to your computer and use it in GitHub Desktop.
Save jarshwah/1e683416d2ed2df28f254fc787d0d304 to your computer and use it in GitHub Desktop.
annotating your manager for useful type hints
class MyModel(models.Model):
name = models.CharField()
objects: models.QuerySet["MyModel"]
MyModel.objects.filter().first()
@jarshwah
Copy link
Author

Screenshot 2022-12-22 at 9 02 15 am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment