Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Changes between Version 15 and Version 16 of Search_Pagination


Ignore:
Timestamp:
03/24/06 00:47:02 (13 years ago)
Author:
fredlin
Comment:

offset

Legend:

Unmodified
Added
Removed
Modified
  • Search_Pagination

    v15 v16  
    104104<?python 
    105105    query_size = context.count()+1 
    106     end = start*10 +offset 
     106    end = start*offset +offset 
    107107?> 
    108108<ul> 
     
    133133 
    134134{{{ 
    135 <span py:if = "start!=0"> <a href = "/?start=${(start/10)-1}">Prev</a> </span> 
     135<span py:if = "start!=0"> <a href = "/?start=${(start/offset)-1}">Prev</a> </span> 
    136136}}} 
    137137 
     
    140140compare "set_end" and "set_size" to decide if we need to show the "Next" button. 
    141141{{{ 
    142 <span py:if = "end &#x03C; query_size"><a href = "/?start=${(start/10)+1}">Next</a> </span> 
     142<span py:if = "end &#x03C; query_size"><a href = "/?start=${(start/offset)+1}">Next</a> </span> 
    143143}}} 
    144144 
     
    162162 
    163163   {{{ 
    164 <span py:if = "query_size >= end"><a href = "/?start=${(start/10)+1}">Next</a> </span> 
     164<span py:if = "query_size >= end"><a href = "/?start=${(start/offset)+1}">Next</a> </span> 
    165165}}} 
    166166 
     
    180180def index(self, start = 0): 
    181181    a = TableEntry.select(TableEntry.q.fieldA == True, orderBy='fieldB') 
    182     offset = 20 
    183     start = int(start)*10 
     182    offset = 10 
     183    start = int(start)*offset 
    184184    query_size = a.count() 
    185185    end = start+offset 
     
    201201    a = TableEntry.select(TableEntry.q.fieldA == True, orderBy='fieldB') 
    202202    return dict(context = a[start:(start+offset)], 
    203                 start = int(start)*10,  
    204                 offset = 20,  
     203                offset = 10,                 
     204                start = int(start)*offset,  
    205205                query_size = a.count(),  
    206206                end = start+offset,