Ignore:
Timestamp:
15/10/09 10:00:36 (11 years ago)
Author:
sdonegan
Message:

Updates to allow proper paging as per num of search results and ordering of orderby without letter prefix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/discovery.py

    r5785 r5844  
    6464        #nb. webhelpers suck so no wuse own construct of option vals based on bc.ORDERBY_SENSIBLE_NAMES 
    6565        orderSensibleNames = bc.ORDERBY_SENSIBLE_NAMES 
    66          
    67         orderSensibleNamesSorted = {} 
    68                 
    69         sortedKeys = orderSensibleNames.keys() 
    70         sortedKeys.sort() 
    71         optionList=[] # do it myself. who needs webHelpers anyway. 
    72  
    73              
    74         for orderSel in sortedKeys: 
     66        orderOrderingList = bc.ORDERING_KEY #now use this ordering key to provide ordering in list. 
     67               
     68        optionList=[] # do it myself. who needs webHelpers anyway.#TODI: abstract a webhelpers class so can provide an orderlist as index etc (like we've done here). 
     69 
     70             
     71        for orderSel in orderOrderingList: 
    7572             
    7673            if orderSensibleNames[orderSel] in g.orderByList: 
     
    8178                else:            
    8279                    optionList.append("<option value=\"" + orderSensibleNames[orderSel] + "\">" + orderSel + "</option>") 
    83                  
    84                  
    85                 #python is useless when it comes to handling dictionaries - arbritrary sorting!  this sucks.  use java.  grrr. 
    86                 orderSensibleNamesSorted[orderSel] = orderSensibleNames[orderSel] 
    87                  
     80                                
    8881            else: 
    8982                 
    9083                optionList.append("<option value=\"" + orderSel + "\">" + orderSel + "</option>")               
    91                 orderSensibleNamesSorted[orderSel] = orderSel 
    92          
    93          
    94         
    95         #c.orderByList = h.options_for_select(g.orderByList, self.inputs['orderBy']) 
    96         #c.orderByList = h.options_for_select(kkk, self.inputs['orderBy'])         
     84                 
     85         
     86        #TODO - see above 
     87        #c.orderByList = h.options_for_select(g.orderByList, self.inputs['orderBy'])         
    9788        c.orderByList = optionList # see above comment on how much python sucks when it comes to dictionaries!  If you don't believe me uncomment above lines. 
    9889 
     
    374365        
    375366         
     367        print "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv  " 
    376368         
    377369        hits = searchClient.hits 
Note: See TracChangeset for help on using the changeset viewer.