Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#15715 closed New feature (fixed)

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

Reported by: Dan McGee 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 Dan McGee 6 years ago.
Possible documentation update

Download all attachments as: .zip

Change History (7)

Changed 6 years ago by Dan McGee

Attachment: perm-reqd-example.patch added

Possible documentation update

comment:1 Changed 6 years ago by Gabriel Hurley

Triage Stage: UnreviewedAccepted

comment:2 Changed 6 years ago by Luke Plant

Type: New feature

comment:3 Changed 6 years ago by Luke Plant

Severity: Normal

comment:4 Changed 5 years ago by Julien Phalip

Easy pickings: unset
Triage Stage: AcceptedReady for checkin
UI/UX: unset

That's great, thank you!

comment:5 Changed 5 years ago by Simon Meers

Resolution: fixed
Status: newclosed

In [16534]:

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

comment:6 Changed 5 years ago by Simon Meers

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