mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
magic-removal: doc model detail views now correctly show model methods callable from the template
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
90d5426adc
commit
dc0fe82957
@ -185,7 +185,7 @@ def model_detail(request, app_label, model_name):
|
||||
|
||||
# Gather model methods.
|
||||
for func_name, func in model.__dict__.items():
|
||||
if (inspect.isfunction(func) or inspect.ismethod(func)) and len(inspect.getargspec(func)[0]) == 0:
|
||||
if (inspect.isfunction(func) and len(inspect.getargspec(func)[0]) == 1):
|
||||
try:
|
||||
for exclude in MODEL_METHODS_EXCLUDE:
|
||||
if func_name.startswith(exclude):
|
||||
|
Loading…
x
Reference in New Issue
Block a user