Subversion Repositories SmartDukaan

Rev

Rev 14640 | Rev 14670 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14640 Rev 14668
Line 274... Line 274...
274
    cursor = collection.find({"userId":userId})
274
    cursor = collection.find({"userId":userId})
275
    total_count = cursor.count()
275
    total_count = cursor.count()
276
    pages = total_count/window + (0 if total_count%window==0 else 1)  
276
    pages = total_count/window + (0 if total_count%window==0 else 1)  
277
    print "total_count", total_count
277
    print "total_count", total_count
278
    if total_count > skip:
278
    if total_count > skip:
279
        cursor = cursor.skip(skip).limit(window).sort([('batchId',-1)])
279
        cursor = cursor.skip(skip).limit(window).sort([('batch',-1)])
280
        refunds = []
280
        refunds = []
281
        for refund in cursor:
281
        for refund in cursor:
282
            del(refund["_id"])
282
            del(refund["_id"])
283
            refunds.append(refund)
283
            refunds.append(refund)
284
        result['data'] = refunds
284
        result['data'] = refunds