Show More
@@ -1,110 +1,110 b'' | |||||
1 | # -*- coding: utf-8 -*- |
|
1 | # -*- coding: utf-8 -*- | |
2 | from south.utils import datetime_utils as datetime |
|
2 | from south.utils import datetime_utils as datetime | |
3 | from south.db import db |
|
3 | from south.db import db | |
4 | from south.v2 import DataMigration |
|
4 | from south.v2 import DataMigration | |
5 | from django.db import models |
|
5 | from django.db import models | |
6 |
|
6 | |||
7 |
|
7 | |||
8 | class Migration(DataMigration): |
|
8 | class Migration(DataMigration): | |
9 |
|
9 | |||
10 | def forwards(self, orm): |
|
10 | def forwards(self, orm): | |
11 | for post in orm['boards.Post'].objects.all(): |
|
11 | for post in orm['boards.Post'].objects.all(): | |
12 | if post.image: |
|
12 | if post.image: | |
13 | image = orm['boards.PostImage']() |
|
13 | image = orm['boards.PostImage']() | |
14 |
|
14 | |||
15 | image.width = post.image_width |
|
15 | image.width = post.image_width | |
16 | image.height = post.image_height |
|
16 | image.height = post.image_height | |
17 |
|
17 | |||
18 | image.pre_width = post.image_pre_width |
|
18 | image.pre_width = post.image_pre_width | |
19 | image.pre_height = post.image_pre_height |
|
19 | image.pre_height = post.image_pre_height | |
20 |
|
20 | |||
21 | image.image = post.image |
|
21 | image.image = post.image | |
22 | image.hash = post.image_hash |
|
22 | image.hash = post.image_hash | |
23 |
|
23 | |||
24 | image.save() |
|
24 | image.save() | |
25 |
|
25 | |||
|
26 | post.images.clear() | |||
26 | post.images.add(image) |
|
27 | post.images.add(image) | |
27 | post.save() |
|
|||
28 |
|
28 | |||
29 | def backwards(self, orm): |
|
29 | def backwards(self, orm): | |
30 | "Write your backwards methods here." |
|
30 | "Write your backwards methods here." | |
31 |
|
31 | |||
32 | models = { |
|
32 | models = { | |
33 | 'boards.ban': { |
|
33 | 'boards.ban': { | |
34 | 'Meta': {'object_name': 'Ban'}, |
|
34 | 'Meta': {'object_name': 'Ban'}, | |
35 | 'can_read': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), |
|
35 | 'can_read': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | |
36 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
36 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
37 | 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), |
|
37 | 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), | |
38 | 'reason': ('django.db.models.fields.CharField', [], {'default': "'Auto'", 'max_length': '200'}) |
|
38 | 'reason': ('django.db.models.fields.CharField', [], {'default': "'Auto'", 'max_length': '200'}) | |
39 | }, |
|
39 | }, | |
40 | 'boards.post': { |
|
40 | 'boards.post': { | |
41 | 'Meta': {'ordering': "('id',)", 'object_name': 'Post'}, |
|
41 | 'Meta': {'ordering': "('id',)", 'object_name': 'Post'}, | |
42 | '_text_rendered': ('django.db.models.fields.TextField', [], {}), |
|
42 | '_text_rendered': ('django.db.models.fields.TextField', [], {}), | |
43 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
43 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
44 | 'image': ('boards.thumbs.ImageWithThumbsField', [], {'max_length': '100', 'blank': 'True'}), |
|
44 | 'image': ('boards.thumbs.ImageWithThumbsField', [], {'max_length': '100', 'blank': 'True'}), | |
45 | 'image_hash': ('django.db.models.fields.CharField', [], {'max_length': '36'}), |
|
45 | 'image_hash': ('django.db.models.fields.CharField', [], {'max_length': '36'}), | |
46 | 'image_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
46 | 'image_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
47 | 'image_pre_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
47 | 'image_pre_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
48 | 'image_pre_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
48 | 'image_pre_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
49 | 'image_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
49 | 'image_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
50 | 'images': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'ip+'", 'to': "orm['boards.PostImage']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True', 'db_index': 'True'}), |
|
50 | 'images': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'ip+'", 'to': "orm['boards.PostImage']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True', 'db_index': 'True'}), | |
51 | 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), |
|
51 | 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), | |
52 | 'poster_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), |
|
52 | 'poster_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), | |
53 | 'poster_user_agent': ('django.db.models.fields.TextField', [], {}), |
|
53 | 'poster_user_agent': ('django.db.models.fields.TextField', [], {}), | |
54 | 'pub_time': ('django.db.models.fields.DateTimeField', [], {}), |
|
54 | 'pub_time': ('django.db.models.fields.DateTimeField', [], {}), | |
55 | 'referenced_posts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'rfp+'", 'to': "orm['boards.Post']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True', 'db_index': 'True'}), |
|
55 | 'referenced_posts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'rfp+'", 'to': "orm['boards.Post']", 'blank': 'True', 'symmetrical': 'False', 'null': 'True', 'db_index': 'True'}), | |
56 | 'refmap': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), |
|
56 | 'refmap': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}), | |
57 | 'text': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True'}), |
|
57 | 'text': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True'}), | |
58 | 'text_markup_type': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '30'}), |
|
58 | 'text_markup_type': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '30'}), | |
59 | 'thread_new': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.Thread']", 'null': 'True'}), |
|
59 | 'thread_new': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.Thread']", 'null': 'True'}), | |
60 | 'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}), |
|
60 | 'title': ('django.db.models.fields.CharField', [], {'max_length': '200'}), | |
61 | 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.User']", 'null': 'True'}) |
|
61 | 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.User']", 'null': 'True'}) | |
62 | }, |
|
62 | }, | |
63 | 'boards.postimage': { |
|
63 | 'boards.postimage': { | |
64 | 'Meta': {'ordering': "('id',)", 'object_name': 'PostImage'}, |
|
64 | 'Meta': {'ordering': "('id',)", 'object_name': 'PostImage'}, | |
65 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
65 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
66 | 'image': ('boards.thumbs.ImageWithThumbsField', [], {'max_length': '100', 'blank': 'True'}), |
|
66 | 'image': ('boards.thumbs.ImageWithThumbsField', [], {'max_length': '100', 'blank': 'True'}), | |
67 | 'hash': ('django.db.models.fields.CharField', [], {'max_length': '36'}), |
|
67 | 'hash': ('django.db.models.fields.CharField', [], {'max_length': '36'}), | |
68 | 'height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
68 | 'height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
69 | 'pre_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
69 | 'pre_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
70 | 'pre_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), |
|
70 | 'pre_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), | |
71 | 'width': ('django.db.models.fields.IntegerField', [], {'default': '0'}) |
|
71 | 'width': ('django.db.models.fields.IntegerField', [], {'default': '0'}) | |
72 | }, |
|
72 | }, | |
73 | 'boards.setting': { |
|
73 | 'boards.setting': { | |
74 | 'Meta': {'object_name': 'Setting'}, |
|
74 | 'Meta': {'object_name': 'Setting'}, | |
75 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
75 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
76 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), |
|
76 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), | |
77 | 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.User']"}), |
|
77 | 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.User']"}), | |
78 | 'value': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
|
78 | 'value': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | |
79 | }, |
|
79 | }, | |
80 | 'boards.tag': { |
|
80 | 'boards.tag': { | |
81 | 'Meta': {'ordering': "('name',)", 'object_name': 'Tag'}, |
|
81 | 'Meta': {'ordering': "('name',)", 'object_name': 'Tag'}, | |
82 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
82 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
83 | 'linked': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), |
|
83 | 'linked': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), | |
84 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}), |
|
84 | 'name': ('django.db.models.fields.CharField', [], {'max_length': '100', 'db_index': 'True'}), | |
85 | 'threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tag+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Thread']"}) |
|
85 | 'threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tag+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Thread']"}) | |
86 | }, |
|
86 | }, | |
87 | 'boards.thread': { |
|
87 | 'boards.thread': { | |
88 | 'Meta': {'object_name': 'Thread'}, |
|
88 | 'Meta': {'object_name': 'Thread'}, | |
89 | 'archived': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), |
|
89 | 'archived': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | |
90 | 'bump_time': ('django.db.models.fields.DateTimeField', [], {}), |
|
90 | 'bump_time': ('django.db.models.fields.DateTimeField', [], {}), | |
91 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
91 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
92 | 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), |
|
92 | 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), | |
93 | 'replies': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tre+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), |
|
93 | 'replies': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tre+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), | |
94 | 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['boards.Tag']", 'symmetrical': 'False'}) |
|
94 | 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['boards.Tag']", 'symmetrical': 'False'}) | |
95 | }, |
|
95 | }, | |
96 | 'boards.user': { |
|
96 | 'boards.user': { | |
97 | 'Meta': {'object_name': 'User'}, |
|
97 | 'Meta': {'object_name': 'User'}, | |
98 | 'fav_tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), |
|
98 | 'fav_tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), | |
99 | 'fav_threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), |
|
99 | 'fav_threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), | |
100 | 'hidden_tags': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'ht+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Tag']"}), |
|
100 | 'hidden_tags': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'ht+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Tag']"}), | |
101 | 'hidden_threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'hth+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), |
|
101 | 'hidden_threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'hth+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), | |
102 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
102 | u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | |
103 | 'rank': ('django.db.models.fields.IntegerField', [], {}), |
|
103 | 'rank': ('django.db.models.fields.IntegerField', [], {}), | |
104 | 'registration_time': ('django.db.models.fields.DateTimeField', [], {}), |
|
104 | 'registration_time': ('django.db.models.fields.DateTimeField', [], {}), | |
105 | 'user_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
|
105 | 'user_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | |
106 | } |
|
106 | } | |
107 | } |
|
107 | } | |
108 |
|
108 | |||
109 | complete_apps = ['boards'] |
|
109 | complete_apps = ['boards'] | |
110 | symmetrical = True |
|
110 | symmetrical = True |
General Comments 0
You need to be logged in to leave comments.
Login now