Add support for URL reversing for local sites.
Review Request #2008 — Created Dec. 19, 2010 and submitted — Latest diff uploaded
Add support for URL reversing for local sites. This adds a new local_site_reverse function in reviewboard.site.urlresolvers that can, given a local_site_name or request, attempt to reverse the URL with that site name. This makes it easy to write a function that points to the correct URL depending on whether or not the user is accessing a local site. Call sites have been updated to use the new function. The review request models have also been updated to use this in the get_absolute_url functions. There shouldn't be any manual URL generation left at this point.
Unit tests pass. Playing around with the dashboard and review request pages on both localsites and non-localsites provide the links I'd expect.
Diff Revision 1
This is not the most recent revision of the diff. The latest diff is revision 2. See what's changed.
orig
1
2
reviewboard/settings.py |
---|
reviewboard/urls.py |
---|
reviewboard/accounts/views.py |
---|
reviewboard/admin/middleware.py |
---|
reviewboard/reviews/datagrids.py |
---|
reviewboard/reviews/models.py |
---|
reviewboard/reviews/urls.py |
---|
reviewboard/reviews/templatetags/reviewtags.py |
---|
reviewboard/site/context_processors.py |
---|
reviewboard/site/middleware.py |
---|
reviewboard/site/tests.py |
---|
reviewboard/site/urlresolvers.py |
---|
reviewboard/site/templatetags/__init__.py |
---|
reviewboard/site/templatetags/localsite.py |
---|
reviewboard/webapi/resources.py |
---|