#36773: ManyToMany related manager .count() returns 0 while .all().count() 
returns
correct value (Django 5.2.9 and 6.0.0)
-------------------------------------+-------------------------------------
     Reporter:  Daniel Davtyan       |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  6.0
  (models, ORM)                      |
     Severity:  Release blocker      |               Resolution:
     Keywords:  count, django, orm   |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by Daniel Davtyan:

Old description:

> Environment
>
> Django: 5.2.9
>
> Python: 3.12.x
>
> Database: PostgreSQL
>
> OS: (e.g. Ubuntu 22.04 – fill in)
>
> The same code previously worked correctly on Django 4.x. After upgrading
> to Django 5.x (now 6.0), I see a discrepancy between ManyToMany related
> manager .count() and .all().count() in tests.
>
> This looks similar to the regression tracked as #36197, which was fixed
> for ManyToManyField related managers using a through model with to_field,
> but I am still seeing the same symptom on Django 5.2.9.

New description:

 Environment

 Django: 5.2.9

 Python: 3.12.x

 Database: PostgreSQL

 OS:  Ubuntu 22.04

 The same code previously worked correctly on Django 4.x. After upgrading
 to Django 5.x (now 6.0), I see a discrepancy between ManyToMany related
 manager .count() and .all().count() in tests.

 This looks similar to the regression tracked as #36197, which was fixed
 for ManyToManyField related managers using a through model with to_field,
 but I am still seeing the same symptom on Django 5.2.9.

--
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36773#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/0107019ae92d4ec6-e7871a4c-1801-442f-9dd1-2ecd4ced1428-000000%40eu-central-1.amazonses.com.

Reply via email to