简体   繁体   English

Django ModelAdmin response_change 方法

[英]Django ModelAdmin response_change method

I've found that the response_change method on admin.ModelAdmin to be very useful -- yet I don't believe it is documented in the Django docs at https://docs.djangoproject.com/en/1.4/ref/contrib/admin/#modeladmin-methods .我发现 admin.ModelAdmin 上的 response_change 方法非常有用——但我不相信它记录在https://docs.djangoproject.com/en/1.4/ref/contrib/的 Django 文档中admin/#modeladmin-methods Is the source code the only location for details?源代码是详细信息的唯一位置吗? If so, where is it?如果有,它在哪里? I looked here: https://github.com/django/django/tree/master/django/contrib/admin but did not find anything...我在这里看了: https : //github.com/django/django/tree/master/django/contrib/admin但没有找到任何东西......

An example of its effective use is here: http://brandonkonkle.com/blog/2010/oct/4/django-admin-customization-examples/ .其有效使用的示例如下: http : //brandonkonkle.com/blog/2010/oct/4/django-admin-customization-examples/

Thanks!谢谢!

You can find it here: https://github.com/django/django/blob/master/django/contrib/admin/options.py你可以在这里找到它: https : //github.com/django/django/blob/master/django/contrib/admin/options.py

django.contrib.admin is a strange beast since it contains a lot of utility functions, that might be useful for general django but are for its internal use. django.contrib.admin 是一个奇怪的野兽,因为它包含许多实用功能,这些功能可能对一般 django 有用,但仅供内部使用。 This means that they might go away or change between releases and you can't relay on it especially until it makes into core django (or just be prepare to cover it with yout tests).这意味着它们可能会在发布之间消失或更改,并且您无法继续使用它,尤其是在它成为核心 django 之前(或者只是准备用您的测试覆盖它)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM