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
=== modified file 'src/oopstools/NEWS.txt'
--- src/oopstools/NEWS.txt 2011-11-16 23:21:38 +0000
+++ src/oopstools/NEWS.txt 2011-11-21 04:05:25 +0000
@@ -33,6 +33,9 @@
33* The OOPS reporter field - or prefix as it was known - is now shown33* The OOPS reporter field - or prefix as it was known - is now shown
34 in the OOPS details page. (Robert Collins)34 in the OOPS details page. (Robert Collins)
3535
36* The prefix and appinstance values can now be up to 100 characters long.
37 (Robert Collins, #892917)
38
36* The req_vars variable in OOPS reports may now be a dict.39* The req_vars variable in OOPS reports may now be a dict.
37 (Robert Collins, #888866)40 (Robert Collins, #888866)
3841
3942
=== added file 'src/oopstools/oops/migrations/0021_longer_reporter.py'
--- src/oopstools/oops/migrations/0021_longer_reporter.py 1970-01-01 00:00:00 +0000
+++ src/oopstools/oops/migrations/0021_longer_reporter.py 2011-11-21 04:05:25 +0000
@@ -0,0 +1,29 @@
1# Copyright 2011 Canonical Ltd. All rights reserved.
2#
3# This program is free software: you can redistribute it and/or modify
4# it under the terms of the GNU Affero General Public License as published by
5# the Free Software Foundation, either version 3 of the License, or
6# (at your option) any later version.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11# 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
16from django.db import models
17from south.v2 import DataMigration
18from south.db import db
19
20
21class Migration(DataMigration):
22
23 def forwards(self, orm):
24 db.alter_column('oops_prefix', 'value', models.CharField(unique=True, max_length=100))
25 db.alter_column('oops_appinstance', 'title', models.CharField(unique=True, max_length=100))
26
27 def backwards(self, orm):
28 db.alter_column('oops_prefix', 'value', models.CharField(unique=True, max_length=20))
29 db.alter_column('oops_appinstance', 'title', models.CharField(unique=True, max_length=50))
030
=== modified file 'src/oopstools/oops/models.py'
--- src/oopstools/oops/models.py 2011-11-17 16:11:12 +0000
+++ src/oopstools/oops/models.py 2011-11-21 04:05:25 +0000
@@ -105,7 +105,7 @@
105class AppInstance(models.Model):105class AppInstance(models.Model):
106 """The app instance an oops belongs to."""106 """The app instance an oops belongs to."""
107 # lpnet, edge, staging, etc.107 # lpnet, edge, staging, etc.
108 title = models.CharField(unique=True, max_length=50)108 title = models.CharField(unique=True, max_length=100)
109109
110 def __unicode__(self):110 def __unicode__(self):
111 return unicode(self.title)111 return unicode(self.title)
@@ -113,7 +113,7 @@
113113
114class Prefix(models.Model):114class Prefix(models.Model):
115 """Oops prefixes as defined by the app instance configuration."""115 """Oops prefixes as defined by the app instance configuration."""
116 value = models.CharField(unique=True, max_length=20)116 value = models.CharField(unique=True, max_length=100)
117 appinstance = models.ForeignKey(AppInstance)117 appinstance = models.ForeignKey(AppInstance)
118118
119 def __unicode__(self):119 def __unicode__(self):

Subscribers

People subscribed via source and target branches

to all changes: