diff mbox

[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
State Accepted
Headers show

Commit Message

Paul Larson March 17, 2012, 11:21 a.m. UTC
Merge authors:
  Paul Larson <paul.larson@linaro.org>
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 <paul.larson@linaro.org>
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
diff mbox

Patch

=== 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