/timepiece/migrations/0016_auto__add_field_personschedule_user.py

https://bitbucket.org/copelco/django-timepiece/ · Python · 244 lines · 232 code · 9 blank · 3 comment · 0 complexity · 1ec40cb8673eec34a187ac80c59b1961 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. # Adding field 'PersonSchedule.user'
  9. db.add_column('timepiece_personschedule', 'user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], unique=True, null=True), keep_default=False)
  10. def backwards(self, orm):
  11. # Deleting field 'PersonSchedule.user'
  12. db.delete_column('timepiece_personschedule', 'user_id')
  13. db.alter_column('timepiece_personschedule', 'contact_id', models.ForeignKey(orm['crm.Contact'], null=False, blank=True))
  14. models = {
  15. 'auth.group': {
  16. 'Meta': {'object_name': 'Group'},
  17. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  18. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
  19. 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
  20. },
  21. 'auth.permission': {
  22. 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
  23. 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  24. 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
  25. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  26. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  27. },
  28. 'auth.user': {
  29. 'Meta': {'object_name': 'User'},
  30. 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  31. 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
  32. 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  33. 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
  34. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  35. 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  36. 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  37. 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  38. 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
  39. 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
  40. 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  41. 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
  42. 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
  43. },
  44. 'contactinfo.location': {
  45. 'Meta': {'object_name': 'Location'},
  46. 'country': ('django.db.models.fields.related.ForeignKey', [], {'default': "u'US'", 'to': "orm['countries.Country']"}),
  47. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  48. 'type': ('django.db.models.fields.related.ForeignKey', [], {'default': '2', 'to': "orm['contactinfo.LocationType']"})
  49. },
  50. 'contactinfo.locationtype': {
  51. 'Meta': {'object_name': 'LocationType'},
  52. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  53. 'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
  54. 'slug': ('django.db.models.fields.CharField', [], {'max_length': '30'})
  55. },
  56. 'contenttypes.contenttype': {
  57. 'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
  58. 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  59. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  60. 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
  61. 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
  62. },
  63. 'countries.country': {
  64. 'Meta': {'ordering': "('name',)", 'object_name': 'Country', 'db_table': "'country'"},
  65. 'iso': ('django.db.models.fields.CharField', [], {'max_length': '2', 'primary_key': 'True'}),
  66. 'iso3': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True'}),
  67. 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
  68. 'numcode': ('django.db.models.fields.PositiveSmallIntegerField', [], {'null': 'True'}),
  69. 'printable_name': ('django.db.models.fields.CharField', [], {'max_length': '128'})
  70. },
  71. 'crm.businesstype': {
  72. 'Meta': {'object_name': 'BusinessType'},
  73. 'can_view_all_projects': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  74. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  75. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'})
  76. },
  77. 'crm.contact': {
  78. 'Meta': {'object_name': 'Contact'},
  79. 'business_types': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'businesses'", 'blank': 'True', 'to': "orm['crm.BusinessType']"}),
  80. 'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'related_contacts+'", 'symmetrical': 'False', 'through': "orm['crm.ContactRelationship']", 'to': "orm['crm.Contact']"}),
  81. 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  82. 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
  83. 'external_id': ('django.db.models.fields.CharField', [], {'max_length': '32', 'blank': 'True'}),
  84. 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
  85. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  86. 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
  87. 'locations': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['contactinfo.Location']", 'symmetrical': 'False', 'blank': 'True'}),
  88. 'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'blank': 'True'}),
  89. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
  90. 'notes': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  91. 'picture': ('django.db.models.fields.files.ImageField', [], {'max_length': '1048576', 'null': 'True', 'blank': 'True'}),
  92. 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
  93. 'sort_name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  94. 'type': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
  95. 'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'contacts'", 'unique': 'True', 'null': 'True', 'to': "orm['auth.User']"})
  96. },
  97. 'crm.contactrelationship': {
  98. 'Meta': {'unique_together': "(('from_contact', 'to_contact'),)", 'object_name': 'ContactRelationship'},
  99. 'end_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  100. 'from_contact': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'from_contacts'", 'to': "orm['crm.Contact']"}),
  101. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  102. 'start_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
  103. 'to_contact': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'to_contacts'", 'to': "orm['crm.Contact']"}),
  104. 'types': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'contact_relationships'", 'blank': 'True', 'to': "orm['crm.RelationshipType']"})
  105. },
  106. 'crm.interaction': {
  107. 'Meta': {'ordering': "['-date']", 'object_name': 'Interaction'},
  108. 'cdr_id': ('django.db.models.fields.TextField', [], {'null': 'True'}),
  109. 'completed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  110. 'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'interactions'", 'symmetrical': 'False', 'to': "orm['crm.Contact']"}),
  111. 'date': ('django.db.models.fields.DateTimeField', [], {}),
  112. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  113. 'memo': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  114. 'type': ('django.db.models.fields.CharField', [], {'max_length': '15'})
  115. },
  116. 'crm.relationshiptype': {
  117. 'Meta': {'object_name': 'RelationshipType'},
  118. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  119. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
  120. 'slug': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
  121. },
  122. 'timepiece.activity': {
  123. 'Meta': {'ordering': "('name',)", 'object_name': 'Activity'},
  124. 'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '5'}),
  125. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  126. 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
  127. },
  128. 'timepiece.assignmentallocation': {
  129. 'Meta': {'object_name': 'AssignmentAllocation'},
  130. 'assignment': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'blocks'", 'to': "orm['timepiece.ContractAssignment']"}),
  131. 'date': ('django.db.models.fields.DateField', [], {}),
  132. 'hours': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '8', 'decimal_places': '2'}),
  133. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
  134. },
  135. 'timepiece.attribute': {
  136. 'Meta': {'ordering': "('sort_order',)", 'unique_together': "(('type', 'label'),)", 'object_name': 'Attribute'},
  137. 'enable_timetracking': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  138. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  139. 'label': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  140. 'sort_order': ('django.db.models.fields.SmallIntegerField', [], {'null': 'True', 'blank': 'True'}),
  141. 'type': ('django.db.models.fields.CharField', [], {'max_length': '32'})
  142. },
  143. 'timepiece.billingwindow': {
  144. 'Meta': {'object_name': 'BillingWindow'},
  145. 'date': ('django.db.models.fields.DateField', [], {}),
  146. 'end_date': ('django.db.models.fields.DateField', [], {}),
  147. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  148. 'period': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'billing_windows'", 'to': "orm['timepiece.RepeatPeriod']"})
  149. },
  150. 'timepiece.contractassignment': {
  151. 'Meta': {'unique_together': "(('contract', 'contact'),)", 'object_name': 'ContractAssignment'},
  152. 'contact': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'assignments'", 'to': "orm['auth.User']"}),
  153. 'contract': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'assignments'", 'to': "orm['timepiece.ProjectContract']"}),
  154. 'end_date': ('django.db.models.fields.DateField', [], {}),
  155. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  156. 'min_hours_per_week': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
  157. 'num_hours': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '8', 'decimal_places': '2'}),
  158. 'start_date': ('django.db.models.fields.DateField', [], {})
  159. },
  160. 'timepiece.entry': {
  161. 'Meta': {'object_name': 'Entry'},
  162. 'activity': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'entries'", 'null': 'True', 'to': "orm['timepiece.Activity']"}),
  163. 'billable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
  164. 'comments': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
  165. 'date_updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
  166. 'end_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  167. 'hours': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '8', 'decimal_places': '2'}),
  168. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  169. 'location': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entries'", 'to': "orm['timepiece.Location']"}),
  170. 'pause_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
  171. 'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'entries'", 'to': "orm['timepiece.Project']"}),
  172. 'seconds_paused': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
  173. 'start_time': ('django.db.models.fields.DateTimeField', [], {}),
  174. 'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'timepiece_entries'", 'to': "orm['auth.User']"})
  175. },
  176. 'timepiece.location': {
  177. 'Meta': {'object_name': 'Location'},
  178. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  179. 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}),
  180. 'slug': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
  181. },
  182. 'timepiece.personrepeatperiod': {
  183. 'Meta': {'object_name': 'PersonRepeatPeriod'},
  184. 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True', 'null': 'True'}),
  185. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  186. 'repeat_period': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['timepiece.RepeatPeriod']", 'unique': 'True'})
  187. },
  188. 'timepiece.personschedule': {
  189. 'Meta': {'object_name': 'PersonSchedule'},
  190. 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['crm.Contact']", 'unique': 'True'}),
  191. 'end_date': ('django.db.models.fields.DateField', [], {}),
  192. 'hours_per_week': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '8', 'decimal_places': '2'}),
  193. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  194. 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'unique': 'True', 'null': 'True'})
  195. },
  196. 'timepiece.project': {
  197. 'Meta': {'ordering': "('name', 'status', 'type')", 'object_name': 'Project'},
  198. 'billing_period': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'projects'", 'null': 'True', 'to': "orm['timepiece.RepeatPeriod']"}),
  199. 'business': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'business_projects'", 'to': "orm['crm.Contact']"}),
  200. 'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'related_name': "'contact_projects'", 'symmetrical': 'False', 'through': "orm['timepiece.ProjectRelationship']", 'to': "orm['auth.User']"}),
  201. 'description': ('django.db.models.fields.TextField', [], {}),
  202. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  203. 'interactions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['crm.Interaction']", 'symmetrical': 'False', 'blank': 'True'}),
  204. 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
  205. 'point_person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
  206. 'status': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_with_status'", 'to': "orm['timepiece.Attribute']"}),
  207. 'trac_environment': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
  208. 'type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_with_type'", 'to': "orm['timepiece.Attribute']"})
  209. },
  210. 'timepiece.projectcontract': {
  211. 'Meta': {'object_name': 'ProjectContract'},
  212. 'end_date': ('django.db.models.fields.DateField', [], {}),
  213. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  214. 'num_hours': ('django.db.models.fields.DecimalField', [], {'default': '0', 'max_digits': '8', 'decimal_places': '2'}),
  215. 'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'contracts'", 'to': "orm['timepiece.Project']"}),
  216. 'start_date': ('django.db.models.fields.DateField', [], {}),
  217. 'status': ('django.db.models.fields.CharField', [], {'default': "'upcomming'", 'max_length': '32'})
  218. },
  219. 'timepiece.projectrelationship': {
  220. 'Meta': {'unique_together': "(('contact', 'project'),)", 'object_name': 'ProjectRelationship'},
  221. 'contact': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'project_relationships'", 'to': "orm['auth.User']"}),
  222. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  223. 'project': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'project_relationships'", 'to': "orm['timepiece.Project']"}),
  224. 'types': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'project_relationships'", 'blank': 'True', 'to': "orm['crm.RelationshipType']"})
  225. },
  226. 'timepiece.repeatperiod': {
  227. 'Meta': {'object_name': 'RepeatPeriod'},
  228. 'active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
  229. 'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'related_name': "'repeat_periods'", 'blank': 'True', 'through': "orm['timepiece.PersonRepeatPeriod']", 'to': "orm['auth.User']"}),
  230. 'count': ('django.db.models.fields.PositiveSmallIntegerField', [], {}),
  231. 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
  232. 'interval': ('django.db.models.fields.CharField', [], {'max_length': '10'})
  233. }
  234. }
  235. complete_apps = ['timepiece']