Add QuerySet.__aiter__() (#1136)

This commit is contained in:
Adam Johnson
2022-08-28 13:15:28 +01:00
committed by GitHub
parent 0635afa57c
commit 74e31c7562
2 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
- case: sync_for
main: |
from myapp.models import User
for user in User.objects.all():
reveal_type(user) # N: Revealed type is "myapp.models.User"
installed_apps:
- myapp
files:
- path: myapp/__init__.py
- path: myapp/models.py
content: |
from django.db import models
class User(models.Model):
pass
- case: async_for
main: |
from myapp.models import User
async def main():
async for user in User.objects.all():
reveal_type(user) # N: Revealed type is "myapp.models.User"
installed_apps:
- myapp
files:
- path: myapp/__init__.py
- path: myapp/models.py
content: |
from django.db import models
class User(models.Model):
pass