~bac/lazr.batchnavigator/bug-826839

« back to all changes in this revision

Viewing changes to src/lazr/batchnavigator/interfaces.py

  • Committer: Robert Collins
  • Date: 2011-04-11 02:24:56 UTC
  • mfrom: (38.1.4 keyoffset)
  • Revision ID: robert@canonical.com-20110411022456-e2s61h1u1oxymo89
1.2.4: avoid depending on more of the slice protocol than strictly needed to play nice with SQLObjectResultSets.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
        :return: A tuple of bytestrings suitable for inclusion in URLs.
39
39
        """
40
40
 
41
 
    def getSlice(endpoint_memo='', forwards=True):
 
41
    def getSlice(size, endpoint_memo='', forwards=True):
42
42
        """Returns a slice of the results starting after endpoint_memo.
43
43
 
44
44
        Note that endpoint_memo should be a simple string and is untrusted.
45
45
 
 
46
        :param size: The maximum number of entries to return in the slice.
46
47
        :param endpoint_memo: An endpoint memo as returned by getEndpointMemos.
47
48
            If None or '', the edge of the results is used.
48
49
        :param forwards: If True, slice forwards from endpoint_memo. Otherwise
51
52
        :return: An object honouring the tuple protocol, just like 'results' in
52
53
            the IBatchNavigatorFactory constructor call. If forwards was not
53
54
            True, the order will be reversed vs the 'results' object, otherwise
54
 
            it is identical.
 
55
            it is identical. The object should be fully materialized from any
 
56
            backing store and have no more than size elements in it.
55
57
        """
56
58
 
57
59