Add a base collection for resources.

Review Request #4221 — Created June 7, 2013 and submitted

Information

Review Board
master

Reviewers

Add a base collection for resources.

BaseResourceCollection ties into our resource pagination mechanisms to
allow paging through collections of models.

The caller can do an initial fetch() to get the first page, and then
call fetchNext()/fetchPrev() to get subsequent pages.

Or, the caller can call fetchAll() to get every instance from the
server.
Unit test pass.

Tested with my review dialog change.
Description From Last Updated

I'm kind of confused--does this replace the list or add to it? fetchAll seems to indicate that it adds...

daviddavid
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/collections/baseCollection.js
        reviewboard/static/rb/js/collections/tests/resourceCollectionTests.js
        reviewboard/static/rb/js/collections/resourceCollection.js
    
    
  2. 
      
david
  1. 
      
  2. Show all issues
    I'm kind of confused--does this replace the list or add to it? fetchAll seems to indicate that it adds...
    1. Fetching page-by-page (using fetch/fetchPrev/fetchNext) replaces (by default -- it obeys fetch's standard replace: true/false option, which by default does replace). fetchAll instead populates the collection with all objects across all pages (and to do this, uses replace: false).
  3. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/collections/baseCollection.js
        reviewboard/static/rb/js/collections/tests/resourceCollectionTests.js
        reviewboard/static/rb/js/collections/resourceCollection.js
    
    
  2. 
      
chipx86
reviewbot
  1. This is a review from Review Bot.
      Tool: PEP8 Style Checker
      Processed Files:
        reviewboard/settings.py
      Ignored Files:
        reviewboard/static/rb/js/collections/baseCollection.js
        reviewboard/static/rb/js/collections/tests/resourceCollectionTests.js
        reviewboard/static/rb/js/collections/resourceCollection.js
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed