Changes between Initial Version and Version 1 of Ticket #26964


Ignore:
Timestamp:
Jul 27, 2016, 7:15:01 PM (8 years ago)
Author:
Aidan Lister
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26964 – Description

    initial v1  
    99Suggested wording:
    1010
    11 If you plan to search for child objects which have a generic relation to your parent object, e.g. find all tags linked to a piece of content, then you should consider adding a database index on the content type and object ID using ``index_together`` (https://docs.djangoproject.com/en/1.9/ref/models/options/#index-together). Django does not do this for you automatically as it does with ForeignKey's.
     11If you plan to search for child objects which have a generic relation to your parent object, e.g. find all tags linked to a piece of content, then you should consider adding a database index on the content type and object ID using index_together (https://docs.djangoproject.com/en/1.9/ref/models/options/#index-together). Django does not do this for you automatically as it does with ForeignKey's.
    1212
    1313In the example above, this would look like:
    1414
     15<code>
    1516    class Meta:
    1617        index_together = [
    1718            ["content_type", "object_id"],
    1819        ]
     20</code>
Back to Top