你应该打电话给 get_FIELD_display 作为函数,因此使用()。
get_FIELD_display
a.get_gender_display()
不幸的是,您不能。您只能注释db字段。这篇文章可能对你有帮助 Django annotate model custom method