Opened 17 years ago

Closed 15 years ago

#6371 closed (fixed)

several decorators don't work with bound methods

Reported by: Gary Wilson Owned by: nobody
Component: Core (Other) Version: dev
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Similar to #4376, there are several other decorators that don't work with bound methods. A few that I noticed were cache_page, cache_control, and never_cache from django.views.decorators.cache. cache_page uses decorator_from_middleware, and other decorators created with this "decorator generator" have the same problem. They are django.views.decorators.gzip.gzip_page and django.views.decorators.http.conditional_page.

There might be others lurking out there...

Change History (4)

comment:1 by Mihai Damian, 17 years ago

@cache_page works for shure, just tested it last night

comment:2 by Jacob, 16 years ago

Triage Stage: UnreviewedAccepted

comment:3 by Jacob, 15 years ago

This also applies to the new etag, last_modified, and condition decorators.

comment:4 by Luke Plant, 15 years ago

Resolution: fixed
Status: newclosed

(In [11586]) Fixed #6371 - several decorators don't work with bound methods.

This involved changing the way the internal function
decorator_from_middleware works slightly, breaking some code that relied on
the old behaviour. As a result, it is much simpler, but cache_page has been
made slightly more complex to cope with the change.

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