Django Rest Framework 2.4 TypeError: __init__() got an unexpected keyword argument 'allow_none'

前端 未结 1 1911
不知归路
不知归路 2021-02-10 21:52

This is kind of weird, I get this error TypeError: init() got an unexpected keyword argument \'allow_none\' on DRF 2.4 but it works fine in DRF 2.3.14

I

1条回答
  •  时光说笑
    2021-02-10 22:14

    When trying to reproduce the issue: I cannot reproduce it, if I remove the django model translation stuff.

    name = models.CharField(max_length=155, verbose_name=_('Category'))
    

    becomes

    name = models.CharField(max_length=155, verbose_name='Category')
    

    When doing this for all of your models, and stimulating data. The data serializes just fine.

    0 讨论(0)
提交回复
热议问题