Opened 10 months ago

Last modified 9 months ago

#35179 closed Bug

Admindocs treats model some model methods containing positional-only arguments or keyword-only arguments as attributes — at Version 1

Reported by: David Sanders Owned by: nobody
Component: contrib.admindocs Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by David Sanders)

Given the model:

class Foo(Model):
    def arg_kwarg_method(self, arg, kwarg=None): ...
    def posarg_only_method(self, posarg, /): ...
    def kwarg_only_method(self, *, kwarg): ...
    def posarg_only_and_kwarg_only_method(self, posarg, /, *, kwarg): ...
    def posarg_only_and_arg_and_kwarg_only_method(self, posarg, /, arg, *, kwarg): ...

The following are documented as methods:

  • arg_kwarg_method()
  • posarg_only_method()
  • posarg_only_and_kwarg_only_method()

The following are documented as attributes:

  • kwarg_only_method()
  • posarg_only_and_arg_and_kwarg_only_method()

Change History (2)

comment:1 by David Sanders, 10 months ago

Description: modified (diff)
Summary: Admindocs omits model methods containing only keyword-only argumentsAdmindocs treats model some model methods containing positional-only arguments or keyword-only arguments as attributes

by David Sanders, 10 months ago

Attachment: admindocs.png added

Screenshot of admindocs treating some methods as attributes

Note: See TracTickets for help on using tickets.
Back to Top