Changes between Initial Version and Version 1 of Ticket #26964
- Timestamp:
- Jul 27, 2016, 7:15:01 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #26964 – Description
initial v1 9 9 Suggested wording: 10 10 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.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. 12 12 13 13 In the example above, this would look like: 14 14 15 <code> 15 16 class Meta: 16 17 index_together = [ 17 18 ["content_type", "object_id"], 18 19 ] 20 </code>