int() error in django views
- by Hulk
def displaydata(request):
response_dict = {}
offset = int(request.GET.get('iDisplayStart'))
There is an error as, int() argument must be a string or a number at the above said line (i.e,`request.GET.get('iDisplayStart'))
And in the template code,
$(document).ready(function() {
$.ajaxSetup({ cache: false });
oTable = $('#qp_table').dataTable( {
"aoColumns": [
{"sWidth": "5%" },
{"sWidth": "35%" },
{"sWidth": "27%" },
{"sWidth": "15%"},
{ "bSortable": false, "sWidth": "0%"},
{"bSortable": false, "sWidth": "0%"}
],
"aaSorting": [[0, 'asc']],
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/diaplaydata/",
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"bFilter": false,
"oLanguage" : { "sZeroRecords": "No data found", "sProcessing" : "Fetching Data" }
});