Pagination on containers #12
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The following changes add pagination among containers. It is achieved by using a basic form and POST. The backend keeps track of what "marker" the user is at with a list stored in the session. This marker is used in swiftclient.client.get_account's marker paramter (http://docs.openstack.org/developer/python-swiftclient/swiftclient.html#swiftclient.client.get_account) to get containers starting from after the marker.
Some potential changes to this arrangement include:
-Moving the logic from views.py:containerview() to a model?
-Replacing the form post with ajax
A known bug:
-After a user clicks "get next", loads the page, and then refreshes, the next page will load instead of refreshing the current page. This can be fixed by using ajax instead of form/post.
Please let me know your thoughts, I am completely open to any changes to get this patch landed.
Thank you,
Peter
PS The gif below is weird and flashy in the first few seconds but then it calms down and you can see the demo.

Peter