Python 3.x mypy如何处理Django ORM字段定义

Python 3.x mypy如何处理Django ORM字段定义,python-3.x,django-models,mypy,Python 3.x,Django Models,Mypy,我在Django中定义了一种新类型的字段,称为TruncatingCharField,它是CharField的子类。在上运行mypy时 firebase_identifier = TruncatingCharField(max_length=FIREBASE_IDENTIFIER_MAX_LENGTH, db_index=True, unique=True, null=True) 如果不是用户\u profile.firebase\u标识符: 用户\u profile.firebase\u标

我在Django中定义了一种新类型的字段,称为
TruncatingCharField
,它是
CharField
的子类。在上运行mypy时

firebase_identifier = TruncatingCharField(max_length=FIREBASE_IDENTIFIER_MAX_LENGTH, db_index=True, unique=True, null=True)

如果不是用户\u profile.firebase\u标识符:
用户\u profile.firebase\u标识符=firebase\u标识符
if not user_profile.firebase_identifier:
   user_profile.firebase_identifier = firebase_identifier <-- Error
   user_profile.save()