Move the main diffviewer views to extensible class-based views.
Review Request #4471 — Created Aug. 21, 2013 and submitted
Move the main diffviewer views to extensible class-based views. Django's pushing for class-based generic views for things, and in the case of the diff viewer, it provides a lot of advantages. So far, diffviewer has had a nice separation, where the code in diffviewer was able to focus solely on diff-related work, and the code in reviews was able to focus on objects related to review requests. This was getting hard to maintain with the new review UI support in the diff viewer, though, and it was clear a more extensible solution was needed. Now, the code for rendering the diff viewer and diff fragments are class-based. This simplifies part of the code, and gives us a foundation for some better extensibility by subclasses. The code in reviews will soon be able to do a lot more with the resulting renders without having to inject a bunch of new code into diffviewer. No logic was changed, but much of the code moved around. Going forward, some mixins for things like fetching review request data and checking login support will be created to reduce what these classes have to do. I'm leaving them out of this change, though.
Tested standard diffs, interdiffs, and selecting revisions. Unit tests pass.
Description | From | Last Updated |
---|---|---|
local variable 'context' is assigned to but never used |
reviewbot | |
Col: 20 E127 continuation line over-indented for visual indent |
reviewbot | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
There's not a lot of point to having this be a unicode string--it doesn't contain any non-ascii characters, and _() … |
david | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot | |
Col: 9 E123 closing bracket does not match indentation of opening bracket's line |
reviewbot |
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/diffviewer/views.py reviewboard/reviews/urls.py Ignored Files:
- Change Summary:
-
* Switched to standard strings instead of u-prefixed strings in one place. * Updated some logic to use list.setdefault() instead of doing the equivalent of it ourselves. * Added docstrings.
-
This is a review from Review Bot. Tool: Pyflakes Processed Files: reviewboard/reviews/views.py reviewboard/diffviewer/views.py reviewboard/reviews/urls.py Ignored Files: