From: Marek Stępniowski Date: Thu, 23 Apr 2009 20:23:35 +0000 (+0200) Subject: Added wiki links to catalogue.Book and catalogue.Tag models. X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/8d9f0f1b6f7607545370131c60738e37c3fd4d6f?hp=1e5176481313c3129d2f353993dbb721b21ef232 Added wiki links to catalogue.Book and catalogue.Tag models. --- diff --git a/apps/catalogue/migrations/0005_add_wiki_links.py b/apps/catalogue/migrations/0005_add_wiki_links.py new file mode 100644 index 000000000..3ac91df21 --- /dev/null +++ b/apps/catalogue/migrations/0005_add_wiki_links.py @@ -0,0 +1,13 @@ +# -*- coding: utf-8 -*- +from south.db import db +from django.db import models + + +class Migration: + def forwards(self): + db.add_column('catalogue_tag', 'wiki_link', models.CharField(blank=True, max_length=240)) + db.add_column('catalogue_book', 'wiki_link', models.CharField(blank=True, max_length=240)) + + def backwards(self): + db.delete_column('catalogue_tag', 'wiki_link') + db.delete_column('catalogue_book', 'wiki_link') diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index 5bfe6cbb8..4dde4e0d8 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -48,6 +48,7 @@ class Tag(TagBase): user = models.ForeignKey(User, blank=True, null=True) book_count = models.IntegerField(_('book count'), default=0, blank=False, null=False) gazeta_link = models.CharField(blank=True, max_length=240) + wiki_link = models.CharField(blank=True, max_length=240) def has_description(self): return len(self.description) > 0 @@ -90,6 +91,8 @@ class Book(models.Model): parent_number = models.IntegerField(_('parent number'), default=0) extra_info = JSONField(_('extra information')) gazeta_link = models.CharField(blank=True, max_length=240) + wiki_link = models.CharField(blank=True, max_length=240) + # Formats xml_file = models.FileField(_('XML file'), upload_to=book_upload_path('xml'), blank=True)