#12974: Admindocs app introspection omits several model methods
-------------------------------------+-------------------------------------
               Reporter:  jabapyth   |          Owner:  jabapyth
                   Type:  Bug        |         Status:  reopened
              Milestone:             |      Component:  contrib.admin
                Version:  SVN        |       Severity:  Normal
             Resolution:             |       Keywords:  admin, docs,
           Triage Stage:  Accepted   |  method, admindocs
    Needs documentation:  0          |      Has patch:  1
Patch needs improvement:  1          |    Needs tests:  1
                  UI/UX:  0          |  Easy pickings:  0
-------------------------------------+-------------------------------------
Changes (by danols@…):

 * ui_ux:   => 0
 * easy:   => 0


Comment:

 Please note that even if you remove `@models.permlink` from above example
 `get_absolute_url` still fails to be documented in the admin
 documentation. Further more functions that take no arguments that are
 template friendly also fail to be documented (see model definition below).

 However this is not the reason I am adding to this ticket. I believe the
 assumption that admindoc should only document template friendly functions
 is flawed. For the admindoc app to be useful as a documentation portal for
 both the template designer and django programmer all functions should be
 included; template friendly functions can simply be differentiated
 visually.

 Documenting all functions simply means removing
 `len(inspect.getargspec(func)[0]) == 1` from the if statement on line 242.
 If needed I can submit a patch.

 Thank you

 {{{
 class Example(models.Model):
     ### django native method
     def get_absolute_url(self):
         """ I'm not in the admin """
         pass

     def button(self):
         "I'm in the admin"
         pass

     ### extra model functions
     def get_next_order():
         """ I'm not in the admin """
         pass

     name = models.CharField(help_text='Name', max_length=20)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/12974#comment:11>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to