From 072ce13f62184cb65ceddfbf5b741ca64b5f123d Mon Sep 17 00:00:00 2001 From: Kostas Papadimitriou Date: Tue, 31 Jul 2012 16:28:14 +0300 Subject: [PATCH] Changed FAQ entry title length to support longer titles in faq entries --- ...isplay_on_menu__chg_field_question_is_featur.py | 203 ++++++++++++++++++++ cloudcmsfaq/models.py | 2 +- 2 files changed, 204 insertions(+), 1 deletion(-) create mode 100644 cloudcms/migrate/cloudcmsfaq/0008_auto__chg_field_category_display_on_menu__chg_field_question_is_featur.py diff --git a/cloudcms/migrate/cloudcmsfaq/0008_auto__chg_field_category_display_on_menu__chg_field_question_is_featur.py b/cloudcms/migrate/cloudcmsfaq/0008_auto__chg_field_category_display_on_menu__chg_field_question_is_featur.py new file mode 100644 index 0000000..d239dc3 --- /dev/null +++ b/cloudcms/migrate/cloudcmsfaq/0008_auto__chg_field_category_display_on_menu__chg_field_question_is_featur.py @@ -0,0 +1,203 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Changing field 'Category.display_on_menu' + db.alter_column('cloudcmsfaq_category', 'display_on_menu', self.gf('django.db.models.fields.BooleanField')(blank=True)) + + # Changing field 'Question.is_featured' + db.alter_column('cloudcmsfaq_question', 'is_featured', self.gf('django.db.models.fields.BooleanField')(blank=True)) + + # Changing field 'Question.title' + db.alter_column('cloudcmsfaq_question', 'title', self.gf('django.db.models.fields.CharField')(max_length=255)) + + # Changing field 'Question.is_active' + db.alter_column('cloudcmsfaq_question', 'is_active', self.gf('django.db.models.fields.BooleanField')(blank=True)) + + + def backwards(self, orm): + + # Changing field 'Category.display_on_menu' + db.alter_column('cloudcmsfaq_category', 'display_on_menu', self.gf('django.db.models.fields.BooleanField')()) + + # Changing field 'Question.is_featured' + db.alter_column('cloudcmsfaq_question', 'is_featured', self.gf('django.db.models.fields.BooleanField')()) + + # Changing field 'Question.title' + db.alter_column('cloudcmsfaq_question', 'title', self.gf('django.db.models.fields.CharField')(max_length=100)) + + # Changing field 'Question.is_active' + db.alter_column('cloudcmsfaq_question', 'is_active', self.gf('django.db.models.fields.BooleanField')()) + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'cloudcms.application': { + 'Meta': {'object_name': 'Application'}, + 'app_url': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'code': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'extra_styles': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'facebook_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'favicon': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'blank': 'True', 'related_name': "'as_favicon'", 'null': 'True', 'to': "orm['medialibrary.MediaFile']"}), + 'footer_bottom': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'footer_top': ('django.db.models.fields.TextField', [], {'default': "''", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'index_url': ('django.db.models.fields.CharField', [], {'default': "'/'", 'max_length': '255'}), + 'linked_in_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}), + 'logo': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'to': "orm['medialibrary.MediaFile']", 'null': 'True', 'blank': 'True'}), + 'show_twitter_feed_on_top': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'twitter_username': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}) + }, + 'cloudcms.service': { + 'Meta': {'object_name': 'Service'}, + 'class_name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image_faq': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'blank': 'True', 'related_name': "'image_faq'", 'null': 'True', 'to': "orm['medialibrary.MediaFile']"}), + 'image_userguide': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'blank': 'True', 'related_name': "'image_userguide'", 'null': 'True', 'to': "orm['medialibrary.MediaFile']"}), + 'ordering': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) + }, + 'cloudcmsfaq.category': { + 'Meta': {'object_name': 'Category'}, + 'class_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}), + 'display_on_menu': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('feincms.module.medialibrary.fields.MediaFileForeignKey', [], {'to': "orm['medialibrary.MediaFile']", 'null': 'True', 'blank': 'True'}), + 'ordering': ('django.db.models.fields.SmallIntegerField', [], {'default': '0'}) + }, + 'cloudcmsfaq.categorytranslation': { + 'Meta': {'object_name': 'CategoryTranslation'}, + 'description': ('django.db.models.fields.CharField', [], {'max_length': '250', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'language_code': ('django.db.models.fields.CharField', [], {'default': "'en'", 'max_length': '10'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'translations'", 'to': "orm['cloudcmsfaq.Category']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'cloudcmsfaq.imagecontent': { + 'Meta': {'object_name': 'ImageContent', 'db_table': "'cloudcmsfaq_question_imagecontent'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}), + 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'imagecontent_set'", 'to': "orm['cloudcmsfaq.Question']"}), + 'position': ('django.db.models.fields.CharField', [], {'default': "'default'", 'max_length': '10'}), + 'region': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'cloudcmsfaq.question': { + 'Meta': {'object_name': 'Question'}, + 'application': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'faqs'", 'symmetrical': 'False', 'to': "orm['cloudcms.Application']"}), + 'author': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'faqs'", 'to': "orm['auth.User']"}), + 'category': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'faqs'", 'to': "orm['cloudcmsfaq.Category']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_featured': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'language': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'last_changed': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'published_on': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}), + 'service': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'faqs'", 'null': 'True', 'to': "orm['cloudcms.Service']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '100', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'cloudcmsfaq.rawcontent': { + 'Meta': {'object_name': 'RawContent', 'db_table': "'cloudcmsfaq_question_rawcontent'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'rawcontent_set'", 'to': "orm['cloudcmsfaq.Question']"}), + 'region': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'text': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'cloudcmsfaq.richtextcontent': { + 'Meta': {'object_name': 'RichTextContent', 'db_table': "'cloudcmsfaq_question_richtextcontent'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'richtextcontent_set'", 'to': "orm['cloudcmsfaq.Question']"}), + 'region': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'text': ('django.db.models.fields.TextField', [], {'blank': 'True'}) + }, + 'cloudcmsfaq.sectioncontent': { + 'Meta': {'object_name': 'SectionContent', 'db_table': "'cloudcmsfaq_question_sectioncontent'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'mediafile': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'cloudcmsfaq_sectioncontent_set'", 'null': 'True', 'to': "orm['medialibrary.MediaFile']"}), + 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sectioncontent_set'", 'to': "orm['cloudcmsfaq.Question']"}), + 'region': ('django.db.models.fields.CharField', [], {'max_length': '255'}), + 'richtext': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'default': "'block'", 'max_length': '10'}) + }, + 'cloudcmsfaq.templatecontent': { + 'Meta': {'object_name': 'TemplateContent', 'db_table': "'cloudcmsfaq_question_templatecontent'"}, + 'filename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ordering': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'templatecontent_set'", 'to': "orm['cloudcmsfaq.Question']"}), + 'region': ('django.db.models.fields.CharField', [], {'max_length': '255'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'medialibrary.category': { + 'Meta': {'object_name': 'Category'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['medialibrary.Category']"}), + 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '150', 'db_index': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}) + }, + 'medialibrary.mediafile': { + 'Meta': {'object_name': 'MediaFile'}, + 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['medialibrary.Category']", 'null': 'True', 'blank': 'True'}), + 'copyright': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}), + 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '255'}), + 'file_size': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'type': ('django.db.models.fields.CharField', [], {'max_length': '12'}) + }, + 'sites.site': { + 'Meta': {'object_name': 'Site', 'db_table': "'django_site'"}, + 'domain': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + } + } + + complete_apps = ['cloudcmsfaq'] diff --git a/cloudcmsfaq/models.py b/cloudcmsfaq/models.py index 2101105..e687618 100644 --- a/cloudcmsfaq/models.py +++ b/cloudcmsfaq/models.py @@ -130,7 +130,7 @@ class Question(Base): is_active = models.BooleanField(_('is active'), default=True) is_featured = models.BooleanField(_('is featured'), default=False) - title = models.CharField(_('title'), max_length=100) + title = models.CharField(_('title'), max_length=255) slug = models.SlugField(_('slug'), max_length=100, unique_for_date='published_on') author = models.ForeignKey(User, related_name='faqs', verbose_name=_('author')) language = models.CharField(max_length=255, choices=settings.LANGUAGES) -- 1.7.10.4