mirror of
https://github.com/django/django.git
synced 2025-10-06 08:40:42 +00:00
Fixed #21469 -- Allow set objects in Meta.unique_together.
Thanks to Tim for the review.
This commit is contained in:
parent
4cfe6ba6a3
commit
331d79a77d
2 changed files with 36 additions and 1 deletions
|
@ -32,6 +32,7 @@ def normalize_unique_together(unique_together):
|
|||
tuple of two strings. Normalize it to a tuple of tuples, so that
|
||||
calling code can uniformly expect that.
|
||||
"""
|
||||
unique_together = tuple(unique_together)
|
||||
if unique_together and not isinstance(unique_together[0], (tuple, list)):
|
||||
unique_together = (unique_together,)
|
||||
return unique_together
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue