1
0
mirror of https://github.com/django/django.git synced 2025-03-31 03:30:46 +00:00

Refs #27236 -- Removed references to index_together from ModelState.from_model.

It's not possible for ModelMeta.index_together to exist anymore.
This commit is contained in:
Simon Charette 2024-11-16 10:02:11 -05:00 committed by Sarah Boyce
parent 94436dee57
commit 44281bc212

View File

@ -827,9 +827,6 @@ class ModelState:
if name == "unique_together":
ut = model._meta.original_attrs["unique_together"]
options[name] = set(normalize_together(ut))
elif name == "index_together":
it = model._meta.original_attrs["index_together"]
options[name] = set(normalize_together(it))
elif name == "indexes":
indexes = [idx.clone() for idx in model._meta.indexes]
for index in indexes:
@ -845,7 +842,7 @@ class ModelState:
# If we're ignoring relationships, remove all field-listing model
# options (that option basically just means "make a stub model")
if exclude_rels:
for key in ["unique_together", "index_together", "order_with_respect_to"]:
for key in ["unique_together", "order_with_respect_to"]:
if key in options:
del options[key]
# Private fields are ignored, so remove options that refer to them.