PageRenderTime 62ms CodeModel.GetById 25ms RepoModel.GetById 0ms app.codeStats 0ms

/apps/package/migrations/0015_auto__del_repo__del_field_package_repo.py

https://github.com/kennethlove/opencomparison
Python | 143 lines | 127 code | 11 blank | 5 comment | 0 complexity | 853b2be4359449b7dd65510316c2ac9e MD5 | raw file
  1. # encoding: utf-8
  2. import datetime
  3. from south.db import db
  4. from south.v2 import SchemaMigration
  5. from django.db import models
  6. class Migration(SchemaMigration):
  7. def forwards(self, orm):
  8. # Deleting model 'Repo'
  9. db.delete_table('package_repo')
  10. # Deleting field 'Package.repo'
  11. db.delete_column('package_package', 'repo_id')
  12. def backwards(self, orm):
  13. # Adding model 'Repo'
  14. db.create_table('package_repo', (
  15. ('slug_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
  16. ('description', self.gf('django.db.models.fields.TextField')(blank=True)),
  17. ('user_url', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
  18. ('handler', self.gf('django.db.models.fields.CharField')(default='package.handlers.unsupported', max_length='200')),
  19. ('repo_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
  20. ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
  21. ('title', self.gf('django.db.models.fields.CharField')(max_length='50')),
  22. ('url', self.gf('django.db.models.fields.URLField')(max_length=200)),
  23. ('created', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True)),
  24. ('modified', self.gf('django.db.models.fields.DateTimeField')(default=datetime.datetime.now, blank=True)),
  25. ('is_supported', self.gf('django.db.models.fields.BooleanField')(default=False)),
  26. ('user_regex', self.gf('django.db.models.fields.CharField')(max_length='100', blank=True)),
  27. ('is_other', self.gf('django.db.models.fields.BooleanField')(default=False)),
  28. ))
  29. db.send_create_signal('package', ['Repo'])
  30. # Adding field 'Package.repo'
  31. db.add_column('package_package', 'repo', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['package.Repo'], null=True), keep_default=False)
  32. models = {
  33. 'auth.group': {
  34. 'Meta': {'object_name': 'Group'},
  35. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  36. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  37. 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  38. },
  39. 'auth.permission': {
  40. 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
  41. 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  42. 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
  43. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  44. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  45. },
  46. 'auth.user': {
  47. 'Meta': {'object_name': 'User'},
  48. 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  49. 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
  50. 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  51. 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
  52. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  53. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  54. 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  55. 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  56. 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  57. 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  58. 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  59. 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
  60. 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
  61. },
  62. 'contenttypes.contenttype': {
  63. 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  64. 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  65. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  66. 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  67. 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  68. },
  69. 'package.category': {
  70. 'Meta': {'ordering': "['title']", 'object_name': 'Category'},
  71. 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  72. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  73. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  74. 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  75. 'show_pypi': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  76. 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'db_index': 'True'}),
  77. 'title': ('django.db.models.fields.CharField', [], {'max_length': "'50'"}),
  78. 'title_plural': ('django.db.models.fields.CharField', [], {'max_length': "'50'", 'blank': 'True'})
  79. },
  80. 'package.commit': {
  81. 'Meta': {'ordering': "['-commit_date']", 'object_name': 'Commit'},
  82. 'commit_date': ('django.db.models.fields.DateTimeField', [], {}),
  83. 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  84. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  85. 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  86. 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['package.Package']"})
  87. },
  88. 'package.package': {
  89. 'Meta': {'ordering': "['title']", 'object_name': 'Package'},
  90. 'category': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['package.Category']"}),
  91. 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  92. 'created_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'creator'", 'null': 'True', 'to': "orm['auth.User']"}),
  93. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  94. 'last_modified_by': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'modifier'", 'null': 'True', 'to': "orm['auth.User']"}),
  95. 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  96. 'participants': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  97. 'pypi_downloads': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  98. 'pypi_home_page': ('django.db.models.fields.URLField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),
  99. 'pypi_url': ('django.db.models.fields.URLField', [], {'default': "''", 'max_length': '200', 'blank': 'True'}),
  100. 'related_packages': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_packages_rel_+'", 'blank': 'True', 'to': "orm['package.Package']"}),
  101. 'repo_commits': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  102. 'repo_description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  103. 'repo_forks': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  104. 'repo_url': ('django.db.models.fields.URLField', [], {'unique': 'True', 'max_length': '200', 'blank': 'True'}),
  105. 'repo_watchers': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  106. 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
  107. 'title': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
  108. 'usage': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.User']", 'symmetrical': 'False', 'blank': 'True'})
  109. },
  110. 'package.packageexample': {
  111. 'Meta': {'ordering': "['title']", 'object_name': 'PackageExample'},
  112. 'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  113. 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  114. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  115. 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  116. 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['package.Package']"}),
  117. 'title': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
  118. 'url': ('django.db.models.fields.URLField', [], {'max_length': '200'})
  119. },
  120. 'package.version': {
  121. 'Meta': {'ordering': "['-created']", 'object_name': 'Version'},
  122. 'created': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  123. 'downloads': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  124. 'hidden': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  125. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  126. 'license': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
  127. 'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now', 'blank': 'True'}),
  128. 'number': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': "'100'", 'blank': "''"}),
  129. 'package': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['package.Package']", 'null': 'True', 'blank': 'True'})
  130. }
  131. }
  132. complete_apps = ['package']