码迷,mamicode.com
首页 > 其他好文 > 详细

CRM项目自定义的知识点

时间:2018-08-31 19:34:16      阅读:182      评论:0      收藏:0      [点我收藏+]

标签:splay   meta   mod   model   一个   ice   display   choice   定义   



>> 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属性

CRM项目自定义的知识点

标签:splay   meta   mod   model   一个   ice   display   choice   定义   

原文地址:https://www.cnblogs.com/lovelygang/p/9567296.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!