- 论坛徽章:
- 0
|
原帖由 ragkk 于 2006-4-26 19:43 发表
谢谢各位老大的帮助!这个问题我会慢慢研究,现在主要的问题是在django开发当中,相应的资料太少了。
特别是涉及到数据库中的操作对象,现在我是看源代码一个一个功能挖掘出来的,现在看的我头都疼死了。
比较郁 ...
这里有 django m-r 的最新的文档, 包括 db-api, model-api 等:
http://code.djangoproject.com/browser/django/branches/magic-removal/docs
另外, python shell 里可以用 dir() 直接看一个类/对象所具备的方法:
- >>> from django.contrib.auth.models import User
- >>> u = User.objects.get(username__exact='eric')
- >>> dir(u)
- ['AddManipulator', 'ChangeManipulator', 'DoesNotExist', '__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__getattribute__', '__hash__', '__init__', '__metaclass__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', '_collect_sub_objects', '_default_manager', '_get_FIELD_display', '_get_FIELD_filename', '_get_FIELD_height', '_get_FIELD_size', '_get_FIELD_url', '_get_FIELD_width', '_get_image_dimensions', '_get_next_or_previous_by_FIELD', '_get_next_or_previous_in_order', '_get_pk_val', '_meta', '_prepare', '_save_FIELD_file', '_set_related_many_to_many', 'add_to_class', 'article_set' (略)
复制代码 |
|