Add new 'absolute_url' field to Web API Resources

Review Request #4902 — Created Nov. 5, 2013 and submitted

Information

Review Board
master

Reviewers

Add new 'absolute_url' field to Web API Resources

Add a new 'absolute_url' field to BaseFileAttachmentResource,
BaseScreenshotResource, ReviewGroupResource, and ReviewRequestResource.

Unit tests passed.

Description From Last Updated

This is going to cause problems, because the files are not always relative to the server. You need to ensure …

chipx86chipx86

Best to use obj.get_absolute_url() here instead of calling the serialize function. Same with all other instances.

chipx86chipx86

Same comment as with the file attachments.

chipx86chipx86
chipx86
  1. One more thing to do, if you can. While we don't output docs for this yet, and it's a new convention, there's two new pieces of metadata for fields I'd like to see: added_in and deprecated_in.

    For the url fields being removed, there should be:

    'deprecated_in': '2.0',
    

    And for the absolute_url fields being added:

    'added_in': '2.0',
    
  2. This is going to cause problems, because the files are not always relative to the server. You need to ensure that they're not an absolute path first. For example, they may be on Amazon S3.

    1. HttpRequest.build_absolute_uri(location) specifies that "If the location is already an absolute URI, it will not be altered." So this should be fine.

  3. Best to use obj.get_absolute_url() here instead of calling the serialize function. Same with all other instances.

  4. Same comment as with the file attachments.

  5. 
      
ED
david
  1. Edward,

    This looks good, but the patch doesn't apply cleanly anymore. Can you update it?

    Thanks!

  2. 
      
ED
david
  1. Ship It!
  2. 
      
ED
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to master (0995b36). Thanks!
Loading...