Merge lp:~lifeless/python-oops-tools/bug-892917 into lp:python-oops-tools

Proposed by Robert Collins
Status: Merged
Approved by: Robert Collins
Approved revision: 22
Merged at revision: 22
Proposed branch: lp:~lifeless/python-oops-tools/bug-892917
Merge into: lp:python-oops-tools
Diff against target: 69 lines (+34/-2)
3 files modified
src/oopstools/NEWS.txt (+3/-0)
src/oopstools/oops/migrations/0021_longer_reporter.py (+29/-0)
src/oopstools/oops/models.py (+2/-2)
To merge this branch: bzr merge lp:~lifeless/python-oops-tools/bug-892917
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+82841@code.launchpad.net

Commit message

Permit wider prefix and appinstance fields.

Description of the change

Permit wider fields in the DB.

To post a comment you must log in.
22. By Robert Collins

Update the model definitions too.

Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/oopstools/NEWS.txt'
2--- src/oopstools/NEWS.txt 2011-11-16 23:21:38 +0000
3+++ src/oopstools/NEWS.txt 2011-11-21 04:05:25 +0000
4@@ -33,6 +33,9 @@
5 * The OOPS reporter field - or prefix as it was known - is now shown
6 in the OOPS details page. (Robert Collins)
7
8+* The prefix and appinstance values can now be up to 100 characters long.
9+ (Robert Collins, #892917)
10+
11 * The req_vars variable in OOPS reports may now be a dict.
12 (Robert Collins, #888866)
13
14
15=== added file 'src/oopstools/oops/migrations/0021_longer_reporter.py'
16--- src/oopstools/oops/migrations/0021_longer_reporter.py 1970-01-01 00:00:00 +0000
17+++ src/oopstools/oops/migrations/0021_longer_reporter.py 2011-11-21 04:05:25 +0000
18@@ -0,0 +1,29 @@
19+# Copyright 2011 Canonical Ltd. All rights reserved.
20+#
21+# This program is free software: you can redistribute it and/or modify
22+# it under the terms of the GNU Affero General Public License as published by
23+# the Free Software Foundation, either version 3 of the License, or
24+# (at your option) any later version.
25+#
26+# This program is distributed in the hope that it will be useful,
27+# but WITHOUT ANY WARRANTY; without even the implied warranty of
28+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29+# GNU Affero General Public License for more details.
30+#
31+# You should have received a copy of the GNU Affero General Public License
32+# along with this program. If not, see <http://www.gnu.org/licenses/>.
33+
34+from django.db import models
35+from south.v2 import DataMigration
36+from south.db import db
37+
38+
39+class Migration(DataMigration):
40+
41+ def forwards(self, orm):
42+ db.alter_column('oops_prefix', 'value', models.CharField(unique=True, max_length=100))
43+ db.alter_column('oops_appinstance', 'title', models.CharField(unique=True, max_length=100))
44+
45+ def backwards(self, orm):
46+ db.alter_column('oops_prefix', 'value', models.CharField(unique=True, max_length=20))
47+ db.alter_column('oops_appinstance', 'title', models.CharField(unique=True, max_length=50))
48
49=== modified file 'src/oopstools/oops/models.py'
50--- src/oopstools/oops/models.py 2011-11-17 16:11:12 +0000
51+++ src/oopstools/oops/models.py 2011-11-21 04:05:25 +0000
52@@ -105,7 +105,7 @@
53 class AppInstance(models.Model):
54 """The app instance an oops belongs to."""
55 # lpnet, edge, staging, etc.
56- title = models.CharField(unique=True, max_length=50)
57+ title = models.CharField(unique=True, max_length=100)
58
59 def __unicode__(self):
60 return unicode(self.title)
61@@ -113,7 +113,7 @@
62
63 class Prefix(models.Model):
64 """Oops prefixes as defined by the app instance configuration."""
65- value = models.CharField(unique=True, max_length=20)
66+ value = models.CharField(unique=True, max_length=100)
67 appinstance = models.ForeignKey(AppInstance)
68
69 def __unicode__(self):

Subscribers

People subscribed via source and target branches

to all changes: