Improve the "price_per_page" example in the aggregation documentation
This example is not very clear. There has been some talk about it: https://groups.google.com/forum/#!topic/django-users/CqEGJCI5aNs
# Cost per page
>>> from django.db.models import F, FloatField, Sum
>>> Book.objects.all().aggregate(
... price_per_page=Sum(F('price')/F('pages'), output_field=FloatField()))
{'price_per_page': 0.4470664529184653}
Change History
(6)
Summary: |
Improve the "price_per_page" example in the Documentation on Aggregation → Improve the "price_per_page" example in the aggregation documentation
|
Triage Stage: |
Unreviewed → Accepted
|
Has patch: |
set
|
Owner: |
changed from nobody to Rajesh Veeranki
|
Status: |
new → assigned
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
assigned → closed
|
Is use 'Sum' function here just for syntax correct?