Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想从视图中获取类变量中的值,例如 list_display 和 list_filter 。就像是:
def some_view(): print Order.list_display ...
那么您想从模型实例中访问关联的 ModelAdmin 对象吗?这个怎么样:
from django.contrib import admin print admin.site._registry[Order].list_display