Commits

Franck Bret committed 07a7721

Add a migration files for new models fields display_mode + teaser

Comments (0)

Files changed (2)

cmsplugin_photologue/cms_plugins.py

             'photo':        instance.photo,
             'placeholder':  placeholder,
             'slug_field':   'title_slug',
-            'queryset':     Photo.objects.filter(is_public=True),
             'display_mode':     instance.display_mode,
             'css':          instance.get_css_display(),
         })

cmsplugin_photologue/migrations/0002_display_mode.py

+# 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):
+        
+        # Adding model 'PhotologuePhotoTeaserPlugin'
+        db.create_table('cmsplugin_photologuephototeaserplugin', (
+            ('cmsplugin_ptr', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['cms.CMSPlugin'], unique=True, primary_key=True)),
+            ('title', self.gf('django.db.models.fields.CharField')(max_length=255)),
+            ('photo', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['photologue.Photo'])),
+            ('display_mode', self.gf('django.db.models.fields.CharField')(default='3', max_length=1)),
+            ('css', self.gf('django.db.models.fields.CharField')(default='0', max_length=1)),
+            ('page_link', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['cms.Page'], null=True, blank=True)),
+            ('url', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
+            ('description', self.gf('django.db.models.fields.TextField')(null=True, blank=True)),
+            ('template', self.gf('django.db.models.fields.CharField')(default='photologue_teaser_photo.html', max_length=255)),
+        ))
+        db.send_create_signal('cmsplugin_photologue', ['PhotologuePhotoTeaserPlugin'])
+
+        # Adding field 'PhotologueGalleryPlugin.display_mode'
+        db.add_column('cmsplugin_photologuegalleryplugin', 'display_mode', self.gf('django.db.models.fields.CharField')(default='3', max_length=1), keep_default=False)
+
+        # Deleting field 'PhotologuePhotoPlugin.is_thumb'
+        db.delete_column('cmsplugin_photologuephotoplugin', 'is_thumb')
+
+        # Adding field 'PhotologuePhotoPlugin.display_mode'
+        db.add_column('cmsplugin_photologuephotoplugin', 'display_mode', self.gf('django.db.models.fields.CharField')(default='3', max_length=1), keep_default=False)
+
+
+    def backwards(self, orm):
+        
+        # Deleting model 'PhotologuePhotoTeaserPlugin'
+        db.delete_table('cmsplugin_photologuephototeaserplugin')
+
+        # Deleting field 'PhotologueGalleryPlugin.display_mode'
+        db.delete_column('cmsplugin_photologuegalleryplugin', 'display_mode')
+
+        # Adding field 'PhotologuePhotoPlugin.is_thumb'
+        db.add_column('cmsplugin_photologuephotoplugin', 'is_thumb', self.gf('django.db.models.fields.CharField')(default='0', max_length=1), keep_default=False)
+
+        # Deleting field 'PhotologuePhotoPlugin.display_mode'
+        db.delete_column('cmsplugin_photologuephotoplugin', 'display_mode')
+
+
+    models = {
+        'cms.cmsplugin': {
+            'Meta': {'object_name': 'CMSPlugin'},
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'max_length': '15', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.CMSPlugin']", 'null': 'True', 'blank': 'True'}),
+            'placeholder': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Placeholder']", 'null': 'True'}),
+            'plugin_type': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'position': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.page': {
+            'Meta': {'ordering': "('site', 'tree_id', 'lft')", 'object_name': 'Page'},
+            'changed_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+            'created_by': ('django.db.models.fields.CharField', [], {'max_length': '70'}),
+            'creation_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'in_navigation': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+            'level': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'lft': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'limit_visibility_in_menu': ('django.db.models.fields.SmallIntegerField', [], {'default': 'None', 'null': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'login_required': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'moderator_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '1', 'blank': 'True'}),
+            'navigation_extenders': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '80', 'null': 'True', 'blank': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['cms.Page']"}),
+            'placeholders': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['cms.Placeholder']", 'symmetrical': 'False'}),
+            'publication_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+            'publication_end_date': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'}),
+            'published': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'publisher_is_draft': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
+            'publisher_public': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'publisher_draft'", 'unique': 'True', 'null': 'True', 'to': "orm['cms.Page']"}),
+            'publisher_state': ('django.db.models.fields.SmallIntegerField', [], {'default': '0', 'db_index': 'True'}),
+            'reverse_id': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '40', 'null': 'True', 'blank': 'True'}),
+            'rght': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'site': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['sites.Site']"}),
+            'soft_root': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
+            'template': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'tree_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'})
+        },
+        'cms.placeholder': {
+            'Meta': {'object_name': 'Placeholder'},
+            'default_width': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'slot': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'})
+        },
+        'cmsplugin_photologue.photologuegalleryplugin': {
+            'Meta': {'object_name': 'PhotologueGalleryPlugin', 'db_table': "'cmsplugin_photologuegalleryplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'css': ('django.db.models.fields.CharField', [], {'default': "'0'", 'max_length': '1'}),
+            'display_mode': ('django.db.models.fields.CharField', [], {'default': "'3'", 'max_length': '1'}),
+            'gallery': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['photologue.Gallery']"}),
+            'sample_size': ('django.db.models.fields.PositiveSmallIntegerField', [], {'default': '3'}),
+            'template': ('django.db.models.fields.CharField', [], {'default': "'photologue_gallery.html'", 'max_length': '255'})
+        },
+        'cmsplugin_photologue.photologuephotoplugin': {
+            'Meta': {'object_name': 'PhotologuePhotoPlugin', 'db_table': "'cmsplugin_photologuephotoplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'css': ('django.db.models.fields.CharField', [], {'default': "'0'", 'max_length': '1'}),
+            'display_mode': ('django.db.models.fields.CharField', [], {'default': "'3'", 'max_length': '1'}),
+            'photo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['photologue.Photo']"}),
+            'template': ('django.db.models.fields.CharField', [], {'default': "'photologue_photo.html'", 'max_length': '255'})
+        },
+        'cmsplugin_photologue.photologuephototeaserplugin': {
+            'Meta': {'object_name': 'PhotologuePhotoTeaserPlugin', 'db_table': "'cmsplugin_photologuephototeaserplugin'", '_ormbases': ['cms.CMSPlugin']},
+            'cmsplugin_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['cms.CMSPlugin']", 'unique': 'True', 'primary_key': 'True'}),
+            'css': ('django.db.models.fields.CharField', [], {'default': "'0'", 'max_length': '1'}),
+            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'display_mode': ('django.db.models.fields.CharField', [], {'default': "'3'", 'max_length': '1'}),
+            'page_link': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['cms.Page']", 'null': 'True', 'blank': 'True'}),
+            'photo': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['photologue.Photo']"}),
+            'template': ('django.db.models.fields.CharField', [], {'default': "'photologue_teaser_photo.html'", 'max_length': '255'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+            'url': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+        },
+        'photologue.gallery': {
+            'Meta': {'ordering': "['-date_added']", 'object_name': 'Gallery'},
+            'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+            'photos': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'galleries'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['photologue.Photo']"}),
+            'tags': ('tagging.fields.TagField', [], {'default': "''"}),
+            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+            'title_slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'})
+        },
+        'photologue.photo': {
+            'Meta': {'ordering': "['-date_added']", 'object_name': 'Photo'},
+            'caption': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'crop_from': ('django.db.models.fields.CharField', [], {'default': "'center'", 'max_length': '10', 'blank': 'True'}),
+            'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'date_taken': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
+            'effect': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'photo_related'", 'null': 'True', 'to': "orm['photologue.PhotoEffect']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'blank': 'True'}),
+            'is_public': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+            'tags': ('tagging.fields.TagField', [], {'default': "''"}),
+            'title': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}),
+            'title_slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
+            'view_count': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'})
+        },
+        'photologue.photoeffect': {
+            'Meta': {'object_name': 'PhotoEffect'},
+            'background_color': ('django.db.models.fields.CharField', [], {'default': "'#FFFFFF'", 'max_length': '7'}),
+            'brightness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
+            'color': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
+            'contrast': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'filters': ('django.db.models.fields.CharField', [], {'max_length': '200', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '50'}),
+            'reflection_size': ('django.db.models.fields.FloatField', [], {'default': '0'}),
+            'reflection_strength': ('django.db.models.fields.FloatField', [], {'default': '0.59999999999999998'}),
+            'sharpness': ('django.db.models.fields.FloatField', [], {'default': '1.0'}),
+            'transpose_method': ('django.db.models.fields.CharField', [], {'max_length': '15', 'blank': 'True'})
+        },
+        'sites.site': {
+            'Meta': {'ordering': "('domain',)", '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 = ['cmsplugin_photologue']