免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3159 | 回复: 0
打印 上一主题 下一主题

django中ModelBase的属性 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-10-25 18:39 |只看该作者 |倒序浏览
django中model类都是ModelBase的子类。ModelBase是在django.db.models.base中定义的。
如果一个mdoel类是ModelBase的子类,他的属性有:
['DoesNotExist', 'MultipleObjectsReturned', '__class__', '__delattr__', '__dict__',
'__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__metaclass__',
'__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__', '__unicode__', '__weakref__', '_base_manager',
'_collect_sub_objects', '_default_manager', '_deferred', '_get_FIELD_display',
'_get_next_or_previous_by_FIELD', '_get_next_or_previous_in_order', '_get_pk_val',
'_meta', '_set_pk_val', 'delete', 'objects', 'permissions', 'pk',
'prepare_database_save', 'save', 'save_base', 'serializable_value', 'user_set']
其中_meta的属性有:
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__',
'__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__',
'__setattr__', '__str__', '__weakref__', '_field_cache', '_field_name_cache',
'_fields', '_fill_fields_cache', '_fill_m2m_cache', '_fill_related_many_to_many_cache',
'_fill_related_objects_cache', '_join_cache', '_m2m_cache', '_many_to_many',
'_prepare', '_related_many_to_many_cache', '_related_objects_cache', 'abstract',
'abstract_managers', 'add_field', 'add_virtual_field', 'admin', 'app_label',
'auto_field', 'concrete_managers', 'contribute_to_class', 'db_table', 'db_tablespace',
'duplicate_targets', 'fields', 'get_add_permission', 'get_all_field_names',
'get_all_related_m2m_objects_with_model', 'get_all_related_many_to_many_objects',
'get_all_related_objects', 'get_all_related_objects_with_model', 'get_ancestor_link',
'get_base_chain', 'get_change_permission', 'get_delete_permission', 'get_field',
'get_field_by_name', 'get_fields_with_model', 'get_latest_by', 'get_m2m_with_model',
'get_ordered_objects', 'get_parent_list', 'has_auto_field', 'init_name_map',
'installed', 'local_fields', 'local_many_to_many', 'managed', 'many_to_many',
'module_name', 'object_name', 'order_with_respect_to', 'ordering', 'parents',
'permissions', 'pk', 'pk_index', 'proxy', 'proxy_for_model', 'setup_pk',
'setup_proxy', 'unique_together', 'verbose_name', 'verbose_name_plural',
'verbose_name_raw', 'virtual_fields']


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/103690/showart_2078049.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP