#31873: Count in query giving undesired results across models
-------------------------------------+-------------------------------------
               Reporter:  nikijoe    |          Owner:  nobody
                   Type:             |         Status:  new
  Uncategorized                      |
              Component:  Database   |        Version:  3.1
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  model query
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I have models Bill and BillProducts, having Foreignkey relation to Bill
 with fieldname bill. If i try count =
 BillProducts.objects.aggregate(billcount=Count('bill')) it is giving wrong
 results. But count = Bill.objects.aggregate(billcount=Count('id')) giving
 correct results.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/31873>
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 on the web visit 
https://groups.google.com/d/msgid/django-updates/050.527df82ea679caaeba7bda98344cbbea%40djangoproject.com.

Reply via email to