Quick Search: Search Resource

Review Request #2198 — Created March 14, 2011 and submitted

Information

Review Board

Reviewers

This is the resource used by quick search. It provides information on users (username, first name, last name), groups (name, display name), and review requests (id, summaries). 
I tested it through the /search/?q=___ and it works properly. Also, with the autocomplete, it also returns the data I want. 
david
  1. 
      
  2. reviewboard/webapi/resources.py (Diff revision 1)
     
     
     
     
     
     
    Please format this as such:
    
    """
    Provides information on users, groups and review requests.
    
    This is the resource for the autocomplete...
    """
    
    Note the alignment and blank line in there.
  3. reviewboard/webapi/resources.py (Diff revision 1)
     
     
     
     
    This should fit all on one line.
  4. reviewboard/webapi/resources.py (Diff revision 1)
     
     
    Don't remove this line.
  5. 
      
CR
CR
chipx86
  1. 
      
  2. reviewboard/webapi/resources.py (Diff revision 3)
     
     
     
    Put these on the same line. First line is always the summary.
  3. reviewboard/webapi/resources.py (Diff revision 3)
     
     
     
     
     
    No blank line here.
    
    Also, you can actually have fullname=None, q=None, displayname=None, id=None in the arguments list, and use them directly below.
  4. reviewboard/webapi/resources.py (Diff revision 3)
     
     
     
     
    It would be nice to document how this is used and what sort of results you'll get.
  5. reviewboard/webapi/resources.py (Diff revision 3)
     
     
    This will need to factor in the local_site. You should be able to find other queries that do this. Check UserResource for instance.
  6. reviewboard/webapi/resources.py (Diff revision 3)
     
     
     
    Shouldn't set local_site_name to None. It should be an argument in get().
  7. reviewboard/webapi/resources.py (Diff revision 3)
     
     
    You can just reuse 'q'
  8. reviewboard/webapi/resources.py (Diff revision 3)
     
     
    Same.
  9. reviewboard/webapi/resources.py (Diff revision 3)
     
     
     
     
    Indentation is wrong.
  10. 
      
CR
Review request changed
david
  1. This looks good. I'm going to wait to submit it until the search UI is also ready.
  2. 
      
david
  1. Pushed to master as cc328ca. Thanks!
  2.