0005_covert_subtitle_data.py 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. # -*- coding: utf-8 -*-
  2. import datetime
  3. from south.db import db
  4. from south.v2 import DataMigration
  5. from django.db import models
  6. class Migration(DataMigration):
  7. def forwards(self, orm):
  8. "Write your forwards methods here."
  9. # copies all the data from short_description to subtitle
  10. for book in orm["catalog.book"].objects.all():
  11. book.subtitle = book.short_description
  12. book.save()
  13. def backwards(self, orm):
  14. "Write your backwards methods here."
  15. models = {
  16. "auth.group": {
  17. "Meta": {"object_name": "Group"},
  18. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  19. "name": (
  20. "django.db.models.fields.CharField",
  21. [],
  22. {"unique": "True", "max_length": "80"},
  23. ),
  24. "permissions": (
  25. "django.db.models.fields.related.ManyToManyField",
  26. [],
  27. {
  28. "to": "orm['auth.Permission']",
  29. "symmetrical": "False",
  30. "blank": "True",
  31. },
  32. ),
  33. },
  34. "auth.permission": {
  35. "Meta": {
  36. "ordering": "('content_type__app_label', 'content_type__model', 'codename')",
  37. "unique_together": "(('content_type', 'codename'),)",
  38. "object_name": "Permission",
  39. },
  40. "codename": (
  41. "django.db.models.fields.CharField",
  42. [],
  43. {"max_length": "100"},
  44. ),
  45. "content_type": (
  46. "django.db.models.fields.related.ForeignKey",
  47. [],
  48. {"to": "orm['contenttypes.ContentType']"},
  49. ),
  50. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  51. "name": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
  52. },
  53. "auth.user": {
  54. "Meta": {"object_name": "User"},
  55. "date_joined": (
  56. "django.db.models.fields.DateTimeField",
  57. [],
  58. {"default": "datetime.datetime.now"},
  59. ),
  60. "email": (
  61. "django.db.models.fields.EmailField",
  62. [],
  63. {"max_length": "75", "blank": "True"},
  64. ),
  65. "first_name": (
  66. "django.db.models.fields.CharField",
  67. [],
  68. {"max_length": "30", "blank": "True"},
  69. ),
  70. "groups": (
  71. "django.db.models.fields.related.ManyToManyField",
  72. [],
  73. {"to": "orm['auth.Group']", "symmetrical": "False", "blank": "True"},
  74. ),
  75. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  76. "is_active": (
  77. "django.db.models.fields.BooleanField",
  78. [],
  79. {"default": "True"},
  80. ),
  81. "is_staff": (
  82. "django.db.models.fields.BooleanField",
  83. [],
  84. {"default": "False"},
  85. ),
  86. "is_superuser": (
  87. "django.db.models.fields.BooleanField",
  88. [],
  89. {"default": "False"},
  90. ),
  91. "last_login": (
  92. "django.db.models.fields.DateTimeField",
  93. [],
  94. {"default": "datetime.datetime.now"},
  95. ),
  96. "last_name": (
  97. "django.db.models.fields.CharField",
  98. [],
  99. {"max_length": "30", "blank": "True"},
  100. ),
  101. "password": (
  102. "django.db.models.fields.CharField",
  103. [],
  104. {"max_length": "128"},
  105. ),
  106. "user_permissions": (
  107. "django.db.models.fields.related.ManyToManyField",
  108. [],
  109. {
  110. "to": "orm['auth.Permission']",
  111. "symmetrical": "False",
  112. "blank": "True",
  113. },
  114. ),
  115. "username": (
  116. "django.db.models.fields.CharField",
  117. [],
  118. {"unique": "True", "max_length": "30"},
  119. ),
  120. },
  121. "catalog.book": {
  122. "Meta": {"object_name": "Book", "_ormbases": ["catalog.Item"]},
  123. "author_image": (
  124. "sorl.thumbnail.fields.ImageField",
  125. [],
  126. {"max_length": "100", "null": "True", "blank": "True"},
  127. ),
  128. "authors": (
  129. "django.db.models.fields.CharField",
  130. [],
  131. {"max_length": "200", "null": "True", "blank": "True"},
  132. ),
  133. "dimensions": (
  134. "django.db.models.fields.CharField",
  135. [],
  136. {"max_length": "20", "null": "True", "blank": "True"},
  137. ),
  138. "edition": (
  139. "django.db.models.fields.CharField",
  140. [],
  141. {"max_length": "50", "null": "True", "blank": "True"},
  142. ),
  143. "editors": (
  144. "django.db.models.fields.CharField",
  145. [],
  146. {"max_length": "200", "null": "True", "blank": "True"},
  147. ),
  148. "features": (
  149. "django.db.models.fields.CharField",
  150. [],
  151. {"max_length": "100", "null": "True", "blank": "True"},
  152. ),
  153. "genre": (
  154. "django.db.models.fields.CharField",
  155. [],
  156. {"max_length": "100", "null": "True", "blank": "True"},
  157. ),
  158. "illustrator": (
  159. "django.db.models.fields.CharField",
  160. [],
  161. {"max_length": "200", "null": "True", "blank": "True"},
  162. ),
  163. "isbn": (
  164. "django.db.models.fields.CharField",
  165. [],
  166. {"max_length": "20", "null": "True", "blank": "True"},
  167. ),
  168. "item_ptr": (
  169. "django.db.models.fields.related.OneToOneField",
  170. [],
  171. {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
  172. ),
  173. "library_of_congress_number": (
  174. "django.db.models.fields.CharField",
  175. [],
  176. {"max_length": "20", "null": "True", "blank": "True"},
  177. ),
  178. "pages": (
  179. "django.db.models.fields.IntegerField",
  180. [],
  181. {"null": "True", "blank": "True"},
  182. ),
  183. "printer": (
  184. "django.db.models.fields.CharField",
  185. [],
  186. {"max_length": "200", "null": "True", "blank": "True"},
  187. ),
  188. "publish_date": (
  189. "django.db.models.fields.CharField",
  190. [],
  191. {"max_length": "20", "null": "True", "blank": "True"},
  192. ),
  193. "publisher": (
  194. "django.db.models.fields.CharField",
  195. [],
  196. {"max_length": "200", "null": "True", "blank": "True"},
  197. ),
  198. "short_description": (
  199. "django.db.models.fields.CharField",
  200. [],
  201. {"max_length": "100", "null": "True", "blank": "True"},
  202. ),
  203. "subtitle": (
  204. "django.db.models.fields.CharField",
  205. [],
  206. {"max_length": "100", "null": "True", "blank": "True"},
  207. ),
  208. },
  209. "catalog.item": {
  210. "Meta": {"object_name": "Item"},
  211. "created": (
  212. "django.db.models.fields.DateTimeField",
  213. [],
  214. {"auto_now_add": "True", "blank": "True"},
  215. ),
  216. "created_by": (
  217. "django.db.models.fields.related.ForeignKey",
  218. [],
  219. {"related_name": "'+'", "to": "orm['auth.User']"},
  220. ),
  221. "deleted": (
  222. "django.db.models.fields.BooleanField",
  223. [],
  224. {"default": "False"},
  225. ),
  226. "description": (
  227. "django.db.models.fields.CharField",
  228. [],
  229. {"max_length": "200", "null": "True", "blank": "True"},
  230. ),
  231. "featured": (
  232. "django.db.models.fields.BooleanField",
  233. [],
  234. {"default": "False"},
  235. ),
  236. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  237. "image": (
  238. "sorl.thumbnail.fields.ImageField",
  239. [],
  240. {"max_length": "100", "null": "True", "blank": "True"},
  241. ),
  242. "is_active": (
  243. "django.db.models.fields.BooleanField",
  244. [],
  245. {"default": "True"},
  246. ),
  247. "last_updated": (
  248. "django.db.models.fields.DateTimeField",
  249. [],
  250. {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
  251. ),
  252. "last_updated_by": (
  253. "django.db.models.fields.related.ForeignKey",
  254. [],
  255. {"related_name": "'+'", "to": "orm['auth.User']"},
  256. ),
  257. "price": (
  258. "django.db.models.fields.DecimalField",
  259. [],
  260. {"max_digits": "7", "decimal_places": "2"},
  261. ),
  262. "shipping_cost": (
  263. "django.db.models.fields.DecimalField",
  264. [],
  265. {"max_digits": "7", "decimal_places": "2"},
  266. ),
  267. "shipping_cost_multiple": (
  268. "django.db.models.fields.DecimalField",
  269. [],
  270. {"max_digits": "7", "decimal_places": "2"},
  271. ),
  272. "sku": (
  273. "django.db.models.fields.SlugField",
  274. [],
  275. {"unique": "True", "max_length": "20"},
  276. ),
  277. "subclass_type": (
  278. "django.db.models.fields.CharField",
  279. [],
  280. {"max_length": "200"},
  281. ),
  282. "synopsis": (
  283. "django.db.models.fields.CharField",
  284. [],
  285. {"max_length": "200", "null": "True", "blank": "True"},
  286. ),
  287. "tax_free": (
  288. "django.db.models.fields.BooleanField",
  289. [],
  290. {"default": "False"},
  291. ),
  292. "title": ("django.db.models.fields.CharField", [], {"max_length": "50"}),
  293. },
  294. "catalog.map": {
  295. "Meta": {"object_name": "Map", "_ormbases": ["catalog.Item"]},
  296. "dimensions": (
  297. "django.db.models.fields.CharField",
  298. [],
  299. {"max_length": "20", "null": "True", "blank": "True"},
  300. ),
  301. "item_ptr": (
  302. "django.db.models.fields.related.OneToOneField",
  303. [],
  304. {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
  305. ),
  306. },
  307. "catalog.movie": {
  308. "Meta": {"object_name": "Movie", "_ormbases": ["catalog.Item"]},
  309. "captioning": (
  310. "django.db.models.fields.CharField",
  311. [],
  312. {"max_length": "50", "null": "True", "blank": "True"},
  313. ),
  314. "format": (
  315. "django.db.models.fields.CharField",
  316. [],
  317. {"max_length": "20", "null": "True", "blank": "True"},
  318. ),
  319. "genre": (
  320. "django.db.models.fields.CharField",
  321. [],
  322. {"max_length": "100", "null": "True", "blank": "True"},
  323. ),
  324. "item_ptr": (
  325. "django.db.models.fields.related.OneToOneField",
  326. [],
  327. {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
  328. ),
  329. "language": (
  330. "django.db.models.fields.CharField",
  331. [],
  332. {"max_length": "50", "null": "True", "blank": "True"},
  333. ),
  334. "music": (
  335. "django.db.models.fields.CharField",
  336. [],
  337. {"max_length": "200", "null": "True", "blank": "True"},
  338. ),
  339. "producer": (
  340. "django.db.models.fields.CharField",
  341. [],
  342. {"max_length": "200", "null": "True", "blank": "True"},
  343. ),
  344. "region": (
  345. "django.db.models.fields.CharField",
  346. [],
  347. {"max_length": "50", "null": "True", "blank": "True"},
  348. ),
  349. "runtime_minutes": (
  350. "django.db.models.fields.IntegerField",
  351. [],
  352. {"null": "True", "blank": "True"},
  353. ),
  354. "sound": (
  355. "django.db.models.fields.CharField",
  356. [],
  357. {"max_length": "50", "null": "True", "blank": "True"},
  358. ),
  359. },
  360. "catalog.subscription": {
  361. "Meta": {"object_name": "Subscription", "_ormbases": ["catalog.Item"]},
  362. "duration": ("django.db.models.fields.IntegerField", [], {}),
  363. "item_ptr": (
  364. "django.db.models.fields.related.OneToOneField",
  365. [],
  366. {"to": "orm['catalog.Item']", "unique": "True", "primary_key": "True"},
  367. ),
  368. "shipping_method": (
  369. "django.db.models.fields.CharField",
  370. [],
  371. {"default": "u'REGULAR'", "max_length": "20"},
  372. ),
  373. "shipping_type": (
  374. "django.db.models.fields.CharField",
  375. [],
  376. {"default": "'INSTATE'", "max_length": "10"},
  377. ),
  378. },
  379. "catalog.zipcode": {
  380. "Meta": {"object_name": "ZipCode"},
  381. "city": (
  382. "django.db.models.fields.CharField",
  383. [],
  384. {"max_length": "64", "null": "True", "blank": "True"},
  385. ),
  386. "county": (
  387. "django.db.models.fields.CharField",
  388. [],
  389. {"max_length": "64", "null": "True", "blank": "True"},
  390. ),
  391. "created": (
  392. "django.db.models.fields.DateTimeField",
  393. [],
  394. {"auto_now_add": "True", "blank": "True"},
  395. ),
  396. "created_by": (
  397. "django.db.models.fields.related.ForeignKey",
  398. [],
  399. {"related_name": "'+'", "to": "orm['auth.User']"},
  400. ),
  401. "deleted": (
  402. "django.db.models.fields.BooleanField",
  403. [],
  404. {"default": "False"},
  405. ),
  406. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  407. "is_active": (
  408. "django.db.models.fields.BooleanField",
  409. [],
  410. {"default": "True"},
  411. ),
  412. "last_updated": (
  413. "django.db.models.fields.DateTimeField",
  414. [],
  415. {"auto_now": "True", "auto_now_add": "True", "blank": "True"},
  416. ),
  417. "last_updated_by": (
  418. "django.db.models.fields.related.ForeignKey",
  419. [],
  420. {"related_name": "'+'", "to": "orm['auth.User']"},
  421. ),
  422. "state": (
  423. "django.db.models.fields.CharField",
  424. [],
  425. {"max_length": "2", "null": "True", "blank": "True"},
  426. ),
  427. "zipcode": (
  428. "django.db.models.fields.CharField",
  429. [],
  430. {"unique": "True", "max_length": "9"},
  431. ),
  432. },
  433. "contenttypes.contenttype": {
  434. "Meta": {
  435. "ordering": "('name',)",
  436. "unique_together": "(('app_label', 'model'),)",
  437. "object_name": "ContentType",
  438. "db_table": "'django_content_type'",
  439. },
  440. "app_label": (
  441. "django.db.models.fields.CharField",
  442. [],
  443. {"max_length": "100"},
  444. ),
  445. "id": ("django.db.models.fields.AutoField", [], {"primary_key": "True"}),
  446. "model": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
  447. "name": ("django.db.models.fields.CharField", [], {"max_length": "100"}),
  448. },
  449. }
  450. complete_apps = ["catalog"]
  451. symmetrical = True