﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
19116	documentation models skips some methods	miked@…	nobody	"Admin docs are brilliant and the documentation at https://docs.djangoproject.com/en/dev/ref/contrib/admin/admindocs/#model-reference optimistically says ""The models section of the admindocs page describes each model in the system along with all the fields and methods available on it."" 

In fact it skips methods unless they have exactly one argument. 

This bothers me because I sometimes want model methods to have additional args. It would be better to permit any number of args. 

In contrib/admindocs/views.py at the end of line 235 if one adjusts {{{ == 1 }}} to {{{ > 0 }}} it reveals the skipped methods with no apparent side effects.

There must be a reason it was set this way but maybe it is no longer an issue. 

Here is the patch:
{{{
+++ contrib/admindocs/views.py  Fri Oct 12 16:31:45 2012
@@ -232,7 +232,7 @@

     # Gather model methods.
     for func_name, func in model.__dict__.items():
-        if (inspect.isfunction(func) and len(inspect.getargspec(func)[0]) == 1):
+        if (inspect.isfunction(func) and len(inspect.getargspec(func)[0]) > 0):
             try:
                 for exclude in MODEL_METHODS_EXCLUDE:
                     if func_name.startswith(exclude):

}}}

If this patch is accepted, it makes the app match the documentation so no change to the docs would be required."	Uncategorized	closed	contrib.admindocs	1.4	Normal	invalid	skip methods		Unreviewed	1	0	0	1	1	0
