mirror of
https://github.com/django/django.git
synced 2025-10-28 16:16:12 +00:00
Fixed #22172 -- Allowed index_together to be a single list (rather than list of lists)..
Thanks EmilStenstrom for the suggestion.
This commit is contained in:
committed by
Tim Graham
parent
3273bd7b25
commit
bb2ca9fe6c
@@ -1,7 +1,7 @@
|
||||
from django.apps import AppConfig
|
||||
from django.apps.registry import Apps
|
||||
from django.db import models
|
||||
from django.db.models.options import DEFAULT_NAMES, normalize_unique_together
|
||||
from django.db.models.options import DEFAULT_NAMES, normalize_together
|
||||
from django.utils import six
|
||||
from django.utils.module_loading import import_string
|
||||
|
||||
@@ -145,7 +145,10 @@ class ModelState(object):
|
||||
elif name in model._meta.original_attrs:
|
||||
if name == "unique_together":
|
||||
ut = model._meta.original_attrs["unique_together"]
|
||||
options[name] = set(normalize_unique_together(ut))
|
||||
options[name] = set(normalize_together(ut))
|
||||
elif name == "index_together":
|
||||
it = model._meta.original_attrs["index_together"]
|
||||
options[name] = set(normalize_together(it))
|
||||
else:
|
||||
options[name] = model._meta.original_attrs[name]
|
||||
# Make our record
|
||||
|
||||
Reference in New Issue
Block a user