Ticket #11039: 10870_patch_against_10706.diff

File 10870_patch_against_10706.diff, 1.0 KB (added by psmith, 15 years ago)
  • ref/contrib/contenttypes.txt

     
    339342if a ``Bookmark`` object were deleted, any ``TaggedItem`` objects pointing at
    340343it would be deleted at the same time.
    341344
     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
    342360Generic relations in forms and admin
    343361------------------------------------
    344362
Back to Top