Don't pass a "set" object in the choices argument for a model field

7 views
Skip to first unread message

Tj Johnson

unread,
Mar 7, 2023, 12:18:18 PM3/7/23
to Django users
I just ran into this, a field will accept a "set" object for the choices argument, however since set objects are unordered, it's possible that a new migration will be created every single time makemigrations is run.

debugging this was a matter of noticing that the developer used curly braces instead of parentheses or brackets, it could have been very sticky.  Wondering if this should raise a TypeError


Reply all
Reply to author
Forward
0 new messages