#NEWLINE# def get_combobox_data( request ) : #NEWLINE# #INDENT# 'Return the standard live search data that are posted from a ComboBox widget.\n    summary:\n        A ComboBox using the QueryReadStore sends the following data:\n            name - is the search string (it always ends with a \'*\', that is how the dojo.data API defined it)\n            start - the paging start\n            count - the number of entries to return\n        The ComboBox and QueryReadStore usage should be like this:\n            <div dojoType="dojox.data.QueryReadStore" jsId="topicStore" url="/topic/live-search/..." requestMethod="post" doClientPaging="false"></div>\n            <input {% dojo_widget "rs.widget.Tagcombobox" "addTopicInput" %} store="topicStore" style="width:150px" pageSize="20" />\n        The most important things here are the attributes requestMethod and doClientPaging!\n        The \'doClientPaging\' makes the combobox send \'start\' and \'count\' parameters and the server\n        shall do the paging.\n        \n    returns:\n        a tuple containing\n            search_string - the string typed into the combobox\n            start - at which data set to start\n            end - at which data set to stop\n        \'start\' and \'end\' are already prepared to be directly used in the \n        limit part of the queryset, i.e. Idea.objects.all()[start:end]\n    \n    throws:\n        Exception - if the request method is not POST.\n        ValueError - if start or count parameter is not an int.\n    ' #NEWLINE# if ( not ( request . method == 'POST' ) ) : #NEWLINE# #INDENT# raise Exception ( 'POST request expected.' ) #NEWLINE# #UNINDENT# string = request . POST . get ( 'name' , '' ) #NEWLINE# if string . endswith ( '*' ) : #NEWLINE# #INDENT# string = string [ : ( - 1 ) ] #NEWLINE# #UNINDENT# start = int ( request . POST . get ( 'start' , 0 ) ) #NEWLINE# end = request . POST . get ( 'count' , 10 ) #NEWLINE# if ( not is_number ( end ) ) : #NEWLINE# #INDENT# end = 10 #NEWLINE# #UNINDENT# end = ( start + int ( end ) ) #NEWLINE# return ( string , start , end )