Add support for URL reversing for local sites.

Review Request #2008 — Created Dec. 19, 2010 and submitted

Information

Review Board
master

Reviewers

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.
david
  1. 
      
  2. reviewboard/reviews/models.py (Diff revision 1)
     
     
     
    You can use review_request.display_id here.
    1. Fixed. My code was off an earlier change, so I forgot to incorporate all the display_id stuff.
  3. reviewboard/reviews/models.py (Diff revision 1)
     
     
    You can use self.display_id here
  4. reviewboard/reviews/models.py (Diff revision 1)
     
     
    This should probably be review_request.display_id, no?
  5. 
      
chipx86
Review request changed
david
  1. Ship It!
  2.