db.models.Options.index_together

Options.index_together

Sets of field names that, taken together, are indexed:

index_together = [
    ["pub_date", "deadline"],
]

This list of fields will be indexed together (i.e. the appropriate CREATE INDEX statement will be issued.)

For convenience, index_together can be a single list when dealing with a single set of fields:

index_together = ["pub_date", "deadline"]
doc_Django
2016-10-09 18:35:59
Comments
Leave a Comment

Please login to continue.