Closed
Bug 672545
Opened 14 years ago
Closed 13 years ago
Create a class-based view cache decorator
Categories
(Webtools Graveyard :: Elmo, defect, P5)
Webtools Graveyard
Elmo
Tracking
(Not tracked)
RESOLVED
FIXED
2.2
People
(Reporter: Pike, Assigned: peterbe)
References
Details
Attachments
(1 file)
5.35 KB,
patch
|
Pike
:
review+
|
Details | Diff | Splinter Review |
In bug 650816, I'm kinda hacking around that fact that the cache decorator doesn't work for view classes.
peterbe would like this to look somewhat like
# urls.py
url('/foo', FooView.as_view(), name='foo')
# views.py
@cache_control_view(max_age=60)
class FooView(View):
def get(self)
Assignee | ||
Updated•14 years ago
|
Priority: -- → P5
Assignee | ||
Comment 1•13 years ago
|
||
Actually, it doesn't look like a huge win. However, with this in place we can start adding more decorators later.
Attachment #632061 -
Flags: review?(l10n)
Reporter | ||
Comment 2•13 years ago
|
||
Comment on attachment 632061 [details] [diff] [review]
This is much neater
Review of attachment 632061 [details] [diff] [review]:
-----------------------------------------------------------------
I think there's a left-over import below, r=me with that fixed, or explained.
::: apps/shipping/views/status.py
@@ +4,4 @@
>
> '''Views for shipping metrics.
> '''
> +from collections import defaultdict
Does that belong into this patch?
Attachment #632061 -
Flags: review?(l10n) → review+
Comment 3•13 years ago
|
||
Commit pushed to develop at https://github.com/mozilla/elmo
https://github.com/mozilla/elmo/commit/528920ffaf05acc109d05b42c2b22d9eb6c3476b
bug672545 - class based view decorator utility, r=Pike
Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Axel Hecht [:Pike] from comment #2)
> Comment on attachment 632061 [details] [diff] [review]
> This is much neater
>
> Review of attachment 632061 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> I think there's a left-over import below, r=me with that fixed, or explained.
>
> ::: apps/shipping/views/status.py
> @@ +4,4 @@
> >
> > '''Views for shipping metrics.
> > '''
> > +from collections import defaultdict
>
> Does that belong into this patch?
Not really. I moved it where it belongs (e.g. before app specific imports) but I also had a bunch of other python imports that I needed for my own development which I later didn't need when I wrapped things up. Lastly, I didn't bother moving it back when I realised there was no real change. Sorry that it confused the patch with noise.
Assignee | ||
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Updated•13 years ago
|
Assignee: nobody → peterbe
Target Milestone: --- → 2.2
Updated•5 years ago
|
Product: Webtools → Webtools Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•