From e08f27ad38c6d25994af35a4b6bb515643cef23b Mon Sep 17 00:00:00 2001 From: Chris Van Date: Fri, 13 Jul 2012 00:05:32 -0700 Subject: [PATCH] add a `description` column to `download_sources` table (bug 615405, bug 668456) --- apps/zadmin/models.py | 1 + apps/zadmin/tests/test_models.py | 3 ++- migrations/436-download-sources-description.sql | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 migrations/436-download-sources-description.sql diff --git a/apps/zadmin/models.py b/apps/zadmin/models.py index 924bcfa084..48394b9ef1 100644 --- a/apps/zadmin/models.py +++ b/apps/zadmin/models.py @@ -306,6 +306,7 @@ class DownloadSource(models.Model): # e.g., `full` or `prefix`. type = models.CharField(max_length=255) + description = models.TextField() created = models.DateTimeField(auto_now_add=True) class Meta: diff --git a/apps/zadmin/tests/test_models.py b/apps/zadmin/tests/test_models.py index 9719e318c1..ddc42d4dbf 100644 --- a/apps/zadmin/tests/test_models.py +++ b/apps/zadmin/tests/test_models.py @@ -7,7 +7,8 @@ from zadmin.models import DownloadSource class TestDownloadSource(TestCase): def test_add(self): - created = DownloadSource.objects.create(name='home', type='full') + created = DownloadSource.objects.create(name='home', type='full', + description='This is obviously for the homepage') d = DownloadSource.objects.filter(id=created.id) eq_(d.count(), 1) eq_(d[0].__unicode__(), 'home (full)') diff --git a/migrations/436-download-sources-description.sql b/migrations/436-download-sources-description.sql new file mode 100644 index 0000000000..956c086f31 --- /dev/null +++ b/migrations/436-download-sources-description.sql @@ -0,0 +1 @@ +alter table download_sources add column description mediumtext;