Open joaoariedi opened 1 year ago
Describe the bug The manager .filter and .all methods aren't returning a QuerySet and it's bugging the pydantic serializations for lists.
To Reproduce
>>> from app.companies.models import Company >>> await Company.all() [<Company: 1>, <Company: 2>, <Company: 3>] >>> type(await Company.all()) <class 'list'> >>> await Company.filter(active=True) [<Company: 1>, <Company: 2>, <Company: 3>] >>> type(await Company.filter(active=True)) <class 'list'>
__root__=[submodel.from_orm(e) for e in await queryset.prefetch_related(*fetch_fields)] ^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'list' object has no attribute 'prefetch_related'
Expected behavior A QuerySet object should returns.
Describe the bug The manager .filter and .all methods aren't returning a QuerySet and it's bugging the pydantic serializations for lists.
To Reproduce
Expected behavior A QuerySet object should returns.