简体   繁体   中英

Django admin panel converts None type data to empty string

Any edit made to an object in the django admin panel changes all string fields having None to empty string ie '' .

Is there a workaround or does it requires changes in the django code itself.

Django version: 1.8.5

My guess is that problem within field definition in model, add null=True to allow storing null values within database.

From Django Model field reference#null :

If True, Django will store empty values as NULL in the database. Default is False.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM