| 345 | .. note:: |
| 346 | |
| 347 | You can't currently use :ref:`Django's database aggregation API |
| 348 | <topics-db-aggregation` with a |
| 349 | :class:`~django.contrib.contenttypes.generic.GenericRelation`. For |
| 350 | example, you might be tempted to try something like:: |
| 351 | |
| 352 | Bookmark.objects.aggregate(Count('tags')) |
| 353 | |
| 354 | This will not work correctly, however. The generic relation adds |
| 355 | extra filters to the queryset to ensure the correct content type, |
| 356 | but the ``aggregate`` method doesn't take them into account. For |
| 357 | now, if you need aggregates on generic relations, you'll need to |
| 358 | calculate them without using the aggregation API. |
| 359 | |