开发者

Django's BooleanField showing incorrect value in edit mode

开发者 https://www.devze.com 2023-02-05 22:43 出处:网络
DJango: 1.24 DB: MySQL Colu开发者_如何学编程mn Type: Bit Code: models.BooleanField(db_column=\'InStock\')

DJango: 1.24

DB: MySQL

Colu开发者_如何学编程mn Type: Bit

Code: models.BooleanField(db_column='InStock')

The checkbox always shows checked no matter what the value is (1 or 0). The value gets saved correctly but when it renders the edit page, it always checked.

Any pointers?


You haven't provided much details so I'm guessing that you mean that you have a form and it doesn't have required=False set for the BooleanField.

0

精彩评论

暂无评论...
验证码 换一张
取 消