You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from django.utils.translation import gettext_lazy as _
car_type = models.IntegerField(choices=((1, _('Sedan')), (2, _('Roadster'))), null=True, blank=True)
Raises exception: ValueError: Field 'car_type' expected a number but got 'S'. The 'S' comes from the label "Sedan".
The function FieldTypeGuesser.guess_format() is testing for non-string objects, if type(choice[1]) != str: and the type of this translatable string is: django.utils.functional.lazy.<locals>.__proxy__
My recommendation is test the value like so: if isinstance(choice[1], (tuple, list)):
The text was updated successfully, but these errors were encountered:
Raises exception:
ValueError: Field 'car_type' expected a number but got 'S'.
The 'S' comes from the label "Sedan".The function FieldTypeGuesser.guess_format() is testing for non-string objects,
if type(choice[1]) != str:
and the type of this translatable string is:django.utils.functional.lazy.<locals>.__proxy__
My recommendation is test the value like so:
if isinstance(choice[1], (tuple, list)):
The text was updated successfully, but these errors were encountered: