Merge lp:~nuclearbob/qlbr/drop-searches into lp:~canonical-platform-qa/qlbr/rtm-reports

Proposed by Max Brustkern
Status: Merged
Approved by: Max Brustkern
Approved revision: 124
Merged at revision: 124
Proposed branch: lp:~nuclearbob/qlbr/drop-searches
Merge into: lp:~canonical-platform-qa/qlbr/rtm-reports
Diff against target: 33 lines (+29/-0)
1 file modified
qlbr/management/commands/drop_searches.py (+29/-0)
To merge this branch: bzr merge lp:~nuclearbob/qlbr/drop-searches
Reviewer Review Type Date Requested Status
Thomi Richards (community) Approve
Review via email: mp+236778@code.launchpad.net

Description of the change

This branch adds a command to drop all existing searches. When upgrading a deployment, it would be easier to drop and re-add searches then to try to create a search delta for each upgrade.

To post a comment you must log in.
Revision history for this message
Thomi Richards (thomir-deactivatedaccount) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'qlbr/management/commands/drop_searches.py'
--- qlbr/management/commands/drop_searches.py 1970-01-01 00:00:00 +0000
+++ qlbr/management/commands/drop_searches.py 2014-10-01 20:35:52 +0000
@@ -0,0 +1,29 @@
1# QA Launchpad Bug Reports
2# Copyright 2014 Canonical Ltd.
3
4# This program is free software: you can redistribute it and/or modify it
5# under the terms of the GNU Affero General Public License version 3, as
6# published by the Free Software Foundation.
7
8# This program is distributed in the hope that it will be useful, but
9# WITHOUT ANY WARRANTY; without even the implied warranties of
10# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11# PURPOSE. See the GNU Affero General Public License for more details.
12
13# You should have received a copy of the GNU Affero General Public License
14# along with this program. If not, see <http://www.gnu.org/licenses/>.
15
16"""Delete all searches so they can be freshly loaded."""
17
18from django.core.management.base import BaseCommand
19
20from qlbr.models import Search
21
22
23class Command(BaseCommand):
24
25 """Delete all searches so they can be freshly loaded."""
26
27 def handle(self, *args, **options):
28 """Delete all searches so they can be freshly loaded."""
29 Search.objects.all().delete()

Subscribers

People subscribed via source and target branches