From patchwork Mon Mar 12 03:57:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 7219 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 64ECE23E0C for ; Mon, 12 Mar 2012 03:57:14 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0DCC0A18261 for ; Mon, 12 Mar 2012 03:57:13 +0000 (UTC) Received: by iage36 with SMTP id e36so8094174iag.11 for ; Sun, 11 Mar 2012 20:57:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=XA1TY7g8eC7JTtrk8gtgJ+QzqvWiuGgT9AT0AHL4++E=; b=mE4xuJZEAOtXzAMGno9GuCfxRsYMG40SQz+1E+ncNuyEwkqEyNBqBZNSV65FNri8IL ew9KEQy64YEADIBMtFROlrEcNe+UI8I9L4J/DiBf8nBZN6Oas3D2JSKbWAEM0am3RY8v +6A0PCOAftbwdfBOnDycwr8QXh7AdCAg+WuCxKf4emo7JDJPJm7wJ2fMNYCDFIbmzN2c JSq0trbtYbA7eUQ33D5RRT0i5PDbkzpbJb8DxRy6cMXr64P5mvI108Z8UVMCzRkpSgFL sO4S/hY01PdYgvLFrV3JgyAjzmEyhvGRI+KkWOh0g0W7tciIVVMcyNr7yxInQANfdf0I OObQ== Received: by 10.50.104.199 with SMTP id gg7mr15282618igb.50.1331524633509; Sun, 11 Mar 2012 20:57:13 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp32523ibg; Sun, 11 Mar 2012 20:57:13 -0700 (PDT) Received: by 10.216.132.18 with SMTP id n18mr6255406wei.81.1331524632146; Sun, 11 Mar 2012 20:57:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id h49si16460283wed.67.2012.03.11.20.57.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 11 Mar 2012 20:57:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S6wNi-00050f-VS for ; Mon, 12 Mar 2012 03:57:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id DC00DE1594 for ; Mon, 12 Mar 2012 03:57:10 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-server X-Launchpad-Branch: ~linaro-validation/lava-server/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 354 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-server/trunk] Rev 354: fix incorrect handling of iTotalDisplayRecords and iTotalRecords in handling of ajaxtable methods Message-Id: <20120312035710.10805.56146.launchpad@ackee.canonical.com> Date: Mon, 12 Mar 2012 03:57:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14933"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 50ecb4359e822c1bddb13bd7c9a040304f190fdd X-Gm-Message-State: ALoCoQkuWyl4w+uOzbQTMpMQ7uxG+vQGycyT2IicjT1jue0sJrjDTwZhg6ihkWd/w58/7libIqGS ------------------------------------------------------------ revno: 354 committer: Michael Hudson-Doyle branch nick: trunk timestamp: Mon 2012-03-12 16:55:07 +1300 message: fix incorrect handling of iTotalDisplayRecords and iTotalRecords in handling of ajaxtable methods modified: lava/utils/data_tables/backends.py --- lp:lava-server https://code.launchpad.net/~linaro-validation/lava-server/trunk You are subscribed to branch lp:lava-server. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription === modified file 'lava/utils/data_tables/backends.py' --- lava/utils/data_tables/backends.py 2012-03-07 23:39:48 +0000 +++ lava/utils/data_tables/backends.py 2012-03-12 03:55:07 +0000 @@ -246,7 +246,7 @@ # Get the basic response structure response = super(TableBackend, self).process(query) queryset = self.table.full_queryset - response['iTotalDisplayRecords'] = self.table.full_length + response['iTotalRecords'] = self.table.full_length # 1) Apply search/filtering if query.sSearch: if query.bRegex: @@ -255,11 +255,11 @@ else: if self.table.searchable_columns is None: raise NotImplementedError("Searching is not implemented") - response['iTotalRecords'] = queryset.count() queryset = queryset.filter( self._build_q_for_search(query.sSearch)) + response['iTotalDisplayRecords'] = queryset.count() else: - response['iTotalRecords'] = response['iTotalDisplayRecords'] + response['iTotalDisplayRecords'] = response['iTotalRecords'] # TODO: Support per-column search # 2) Apply sorting queryset = self.apply_sorting_columns(queryset, query.sorting_columns)