From patchwork Sat Mar 17 11:21:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 7341 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 2A46223E00 for ; Sat, 17 Mar 2012 11:21:15 +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 DB473A18366 for ; Sat, 17 Mar 2012 11:21:14 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so8963032iag.11 for ; Sat, 17 Mar 2012 04:21:14 -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=B6PN6BWmJ4vjnZscrmoAvCf9iSUvaNgEuT4hVoqHe3Q=; b=QMeNcaBSe20z0v9KM/5WZtl+npSh3L4YfVya2CUoN9xB5vKgoqDXUtbn3nd/71czdT JD7EJZtMkM5U2HtICtice8HHfGD5lJHImaHTGkOP+G3Gxg2OJo+BmDrE/e5D9AsE6tJx enGgJ8mrezF5YN/CaMva5u5Rd1wzHCmV2TKWMzo2CibkSbF9phpDvffrftlk6WWx/Y8x GePykNs8OoKK/V61Ujuxk/0VYFx3Z/lfu083gzsuM7+V5/6sbNhf+dKPZFtzOeDNFmSh Y5gVmL7ZNmNQvXiBkfK+x6LKDNoTLa+Rt2ycJZAe3UtATjeldXMOA5LxS40uoPbg+OQD jNsA== Received: by 10.50.159.198 with SMTP id xe6mr1916346igb.74.1331983274620; Sat, 17 Mar 2012 04:21:14 -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 k18csp27828ibg; Sat, 17 Mar 2012 04:21:13 -0700 (PDT) Received: by 10.180.107.162 with SMTP id hd2mr5706307wib.8.1331983273016; Sat, 17 Mar 2012 04:21:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id y8si2725389wiy.13.2012.03.17.04.21.12 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 17 Mar 2012 04:21:13 -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 1S8rhA-0004Pg-BR for ; Sat, 17 Mar 2012 11:21:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 47A2FE0109 for ; Sat, 17 Mar 2012 11:21:12 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dashboard X-Launchpad-Branch: ~linaro-validation/lava-dashboard/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 306 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dashboard/trunk] Rev 306: Add an admin function to support deleting an entire bundle, including referenced test runs and re... Message-Id: <20120317112112.18841.92850.launchpad@ackee.canonical.com> Date: Sat, 17 Mar 2012 11:21:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14951"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: fd3b6378188ef4a958dc7a8721222b142594ca90 X-Gm-Message-State: ALoCoQlJOQ8iU78aKNyzOi0q1p8IGmPZSqyJcQQtlaQqI80eR3VqNqoJ+MCA5gxKmth7iJWhoait Merge authors: Paul Larson Related merge proposals: https://code.launchpad.net/~pwlars/lava-dashboard/admin-delete-entire-bundle/+merge/97926 proposed by: Paul Larson (pwlars) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 306 [merge] committer: Paul Larson branch nick: lava-dashboard timestamp: Sat 2012-03-17 06:17:11 -0500 message: Add an admin function to support deleting an entire bundle, including referenced test runs and results modified: dashboard_app/admin.py doc/changes.rst --- lp:lava-dashboard https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk You are subscribed to branch lp:lava-dashboard. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription === modified file 'dashboard_app/admin.py' --- dashboard_app/admin.py 2011-12-20 04:09:12 +0000 +++ dashboard_app/admin.py 2012-03-16 16:57:24 +0000 @@ -42,6 +42,12 @@ TestingEffort, ) +def delete_bundle_action(modeladmin, request, queryset): + for bundle in queryset: + bundle.delete_files() + bundle.delete() +delete_bundle_action.short_description = "Delete bundle and related data" + class BundleAdmin(admin.ModelAdmin): @@ -49,6 +55,7 @@ return bundle.bundle_stream.pathname bundle_stream_pathname.short_description = _("Bundle stream") + actions = [delete_bundle_action] list_display = ('bundle_stream_pathname', 'content_filename', 'uploaded_by', 'uploaded_on', 'is_deserialized') list_filter = ('bundle_stream',) === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-15 20:40:42 +0000 +++ doc/changes.rst 2012-03-17 11:15:24 +0000 @@ -6,6 +6,9 @@ Version 0.14 ============ +* Add an admin function to support deleting an entire bundle, including + referenced test runs and results + .. _version_0_13: Version 0.13