标签:OLE mode str imp 记录 rom style djang def
今天写django项目时,总是没有很好的处理办法,在此记录一下大佬的写法
# models里使用即可
from django.db.models import BooleanField as _BooleanField class BooleanField(_BooleanField): def get_prep_value(self, value): if value in ("0", "false", "False"): return False elif value in ("1", "true", "True"): return True else: return super(BooleanField, self).get_prep_value(value)
标签:OLE mode str imp 记录 rom style djang def
原文地址:https://www.cnblogs.com/zzj666/p/14772522.html