Commits

powersurge360  committed 4899d38

Added migrations.

  • Participants
  • Parent commits fa8393a

Comments (0)

Files changed (3)

File share_search/reviews/migrations/0003_auto__add_photomodel.py

+# -*- coding: 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 'PhotoModel'
+        db.create_table(u'reviews_photomodel', (
+            (u'id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+            ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100)),
+            ('description', self.gf('django.db.models.fields.TextField')()),
+            ('store', self.gf('django.db.models.fields.related.ForeignKey')(related_name='photos', to=orm['reviews.Store'])),
+        ))
+        db.send_create_signal(u'reviews', ['PhotoModel'])
+
+
+    def backwards(self, orm):
+        # Deleting model 'PhotoModel'
+        db.delete_table(u'reviews_photomodel')
+
+
+    models = {
+        u'reviews.photomodel': {
+            'Meta': {'object_name': 'PhotoModel'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'photos'", 'to': u"orm['reviews.Store']"})
+        },
+        u'reviews.product': {
+            'Meta': {'object_name': 'Product'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'description_html': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        u'reviews.productreview': {
+            'Meta': {'object_name': 'ProductReview'},
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'body_markup': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Product']"}),
+            'rating': ('django.db.models.fields.IntegerField', [], {}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'product_reviews'", 'to': u"orm['reviews.Store']"}),
+            'votes': ('django.db.models.fields.IntegerField', [], {})
+        },
+        u'reviews.store': {
+            'Meta': {'object_name': 'Store'},
+            'description': ('django.db.models.fields.TextField', [], {}),
+            'description_html': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
+        },
+        u'reviews.storereview': {
+            'Meta': {'object_name': 'StoreReview'},
+            'body': ('django.db.models.fields.TextField', [], {}),
+            'body_markup': ('django.db.models.fields.TextField', [], {}),
+            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'rating': ('django.db.models.fields.IntegerField', [], {}),
+            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Store']"}),
+            'votes': ('django.db.models.fields.IntegerField', [], {})
+        }
+    }
+
+    complete_apps = ['reviews']

File share_search/reviews/migrations/0003_auto__del_field_store_description_html__del_field_product_description_.py

-# -*- coding: 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):
-        # Deleting field 'Store.description_html'
-        db.delete_column(u'reviews_store', 'description_html')
-
-        # Deleting field 'Product.description_html'
-        db.delete_column(u'reviews_product', 'description_html')
-
-
-    def backwards(self, orm):
-        # Adding field 'Store.description_html'
-        db.add_column(u'reviews_store', 'description_html',
-                      self.gf('django.db.models.fields.TextField')(default=0),
-                      keep_default=False)
-
-        # Adding field 'Product.description_html'
-        db.add_column(u'reviews_product', 'description_html',
-                      self.gf('django.db.models.fields.TextField')(default=''),
-                      keep_default=False)
-
-
-    models = {
-        u'reviews.product': {
-            'Meta': {'object_name': 'Product'},
-            'description': ('django.db.models.fields.TextField', [], {}),
-            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
-            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
-        },
-        u'reviews.productreview': {
-            'Meta': {'object_name': 'ProductReview'},
-            'body': ('django.db.models.fields.TextField', [], {}),
-            'body_markup': ('django.db.models.fields.TextField', [], {}),
-            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
-            'product': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Product']"}),
-            'rating': ('django.db.models.fields.IntegerField', [], {}),
-            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'product_reviews'", 'to': u"orm['reviews.Store']"}),
-            'votes': ('django.db.models.fields.IntegerField', [], {})
-        },
-        u'reviews.store': {
-            'Meta': {'object_name': 'Store'},
-            'description': ('django.db.models.fields.TextField', [], {}),
-            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
-            'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100'}),
-            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
-        },
-        u'reviews.storereview': {
-            'Meta': {'object_name': 'StoreReview'},
-            'body': ('django.db.models.fields.TextField', [], {}),
-            'body_markup': ('django.db.models.fields.TextField', [], {}),
-            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
-            'rating': ('django.db.models.fields.IntegerField', [], {}),
-            'store': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'reviews'", 'to': u"orm['reviews.Store']"}),
-            'votes': ('django.db.models.fields.IntegerField', [], {})
-        }
-    }
-
-    complete_apps = ['reviews']

File share_search/reviews/models.py

 class ProfileModel(models.Model):
     name = models.CharField(max_length=255)
     description = models.TextField()
+    description_html = models.TextField()
 
     class Meta:
         abstract = True
 
 
 class PhotoModel(models.Model):
-    name = models.CharField(max_length=255)
     image = models.ImageField(upload_to="profile_photos")
     description = models.TextField()
-    votes = models.IntegerField()
     store = models.ForeignKey(Store, related_name="photos")
 
-    class Meta:
-        abstract = True
-
 
 class Product(ProfileModel):
     image = models.ImageField(upload_to="product_profile")