Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15715 closed New feature (fixed)

Add a non-trivial decorator example to class-based views docs

Reported by: toofishes Owned by: nobody
Component: Documentation Version: 1.3
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

To save someone the hassle I just had trying to go beyond the all-too-simple @login_required example. This seemed to work for me at least, so I hope it is correct:

    (r'^delete/(?P<pk>\d+)/$',
        permission_required('main.delete_todolist')(DeleteTodolist.as_view())),

Attached a very simple suggestion for the docs, feel free to redo it if it is not in the style but I tried to look at other relevant examples.

Attachments (1)

perm-reqd-example.patch (834 bytes) - added by toofishes 4 years ago.
Possible documentation update

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by toofishes

Possible documentation update

comment:1 Changed 4 years ago by gabrielhurley

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 4 years ago by lukeplant

  • Type set to New feature

comment:3 Changed 4 years ago by lukeplant

  • Severity set to Normal

comment:4 Changed 4 years ago by julien

  • Easy pickings unset
  • Triage Stage changed from Accepted to Ready for checkin
  • UI/UX unset

That's great, thank you!

comment:5 Changed 4 years ago by DrMeers

  • Resolution set to fixed
  • Status changed from new to closed

In [16534]:

Fixed #15715 -- added non-trivial decorator example to CBV docs. Thanks toofishes.

comment:6 Changed 4 years ago by DrMeers

In [16535]:

[1.3.X] Fixed #15715 -- added non-trivial decorator example to CBV docs. Thanks toofishes.

Backport of r16534 from trunk.

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