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

Subscribers

People subscribed via source and target branches