Opened 13 years ago

Closed 13 years ago

Last modified 13 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 13 years ago.
Possible documentation update

Download all attachments as: .zip

Change History (7)

by Dan McGee, 13 years ago

Attachment: perm-reqd-example.patch added

Possible documentation update

comment:1 by Gabriel Hurley, 13 years ago

Triage Stage: UnreviewedAccepted

comment:2 by Luke Plant, 13 years ago

Type: New feature

comment:3 by Luke Plant, 13 years ago

Severity: Normal

comment:4 by Julien Phalip, 13 years ago

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

That's great, thank you!

comment:5 by Simon Meers, 13 years ago

Resolution: fixed
Status: newclosed

In [16534]:

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

comment:6 by Simon Meers, 13 years ago

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