CRM项目自定义的知识点



>> a.get_status_display()
-->: models.CustomerInfo._meta.fields 获取model所有字段对象

>> models.CustomerInfo._meta.get_field('status') 取一个字段的对象
-->: <django.db.models.fields.SmallIntergerField:status>

a = admin_class.model._meta.get_field('name')
a.choices  #取choices属性

猜你喜欢

转载自www.cnblogs.com/lovelygang/p/9567296.html
今日推荐