Revision 4a45ab42

b/snf-astakos-app/astakos/im/migrations/0046_clear_service_auth_token_expires.py
1
# encoding: utf-8
2
import datetime
3
from south.db import db
4
from south.v2 import DataMigration
5
from django.db import models
6

  
7
class Migration(DataMigration):
8

  
9
    def forwards(self, orm):
10
        for s in orm.Service.objects.all():
11
            s.auth_token_expires = None
12
            s.save()
13

  
14
    def backwards(self, orm):
15
        "Write your backwards methods here."
16

  
17

  
18
    models = {
19
        'auth.group': {
20
            'Meta': {'object_name': 'Group'},
21
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
22
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
23
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
24
        },
25
        'auth.permission': {
26
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
27
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
28
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
29
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
30
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
31
        },
32
        'auth.user': {
33
            'Meta': {'object_name': 'User'},
34
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
35
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
36
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
37
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
38
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
39
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
40
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
41
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
42
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
43
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
44
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
45
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
46
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '75'})
47
        },
48
        'contenttypes.contenttype': {
49
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
50
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
51
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
52
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
53
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
54
        },
55
        'im.additionalmail': {
56
            'Meta': {'object_name': 'AdditionalMail'},
57
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
58
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
59
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
60
        },
61
        'im.approvalterms': {
62
            'Meta': {'object_name': 'ApprovalTerms'},
63
            'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 28, 11, 55, 39, 180898)', 'db_index': 'True'}),
64
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
65
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
66
        },
67
        'im.astakosuser': {
68
            'Meta': {'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
69
            'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
70
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
71
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
72
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
73
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
74
            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
75
            'disturbed_quota': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
76
            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
77
            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
78
            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
79
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '100'}),
80
            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
81
            'level': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
82
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
83
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
84
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
85
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
86
            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
87
            'uuid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'})
88
        },
89
        'im.astakosuserauthprovider': {
90
            'Meta': {'ordering': "('module', 'created')", 'unique_together': "(('identifier', 'module', 'user'),)", 'object_name': 'AstakosUserAuthProvider'},
91
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
92
            'affiliation': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
93
            'auth_backend': ('django.db.models.fields.CharField', [], {'default': "'astakos'", 'max_length': '255'}),
94
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
95
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
96
            'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
97
            'info_data': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
98
            'module': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '255'}),
99
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_providers'", 'to': "orm['im.AstakosUser']"})
100
        },
101
        'im.astakosuserquota': {
102
            'Meta': {'unique_together': "(('resource', 'user'),)", 'object_name': 'AstakosUserQuota'},
103
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
104
            'limit': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
105
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
106
            'uplimit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
107
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
108
        },
109
        'im.emailchange': {
110
            'Meta': {'object_name': 'EmailChange'},
111
            'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
112
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
113
            'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
114
            'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 12, 28, 11, 55, 39, 182612)'}),
115
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchanges'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
116
        },
117
        'im.invitation': {
118
            'Meta': {'object_name': 'Invitation'},
119
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
120
            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
121
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
122
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
123
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
124
            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
125
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
126
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
127
        },
128
        'im.memberjoinpolicy': {
129
            'Meta': {'object_name': 'MemberJoinPolicy'},
130
            'description': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
131
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
132
            'policy': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
133
        },
134
        'im.memberleavepolicy': {
135
            'Meta': {'object_name': 'MemberLeavePolicy'},
136
            'description': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
137
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
138
            'policy': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'})
139
        },
140
        'im.pendingthirdpartyuser': {
141
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'PendingThirdPartyUser'},
142
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
143
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
144
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
145
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
146
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
147
            'info': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
148
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
149
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
150
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
151
            'token': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
152
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
153
        },
154
        'im.project': {
155
            'Meta': {'object_name': 'Project'},
156
            'application': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'project'", 'unique': 'True', 'to': "orm['im.ProjectApplication']"}),
157
            'creation_date': ('django.db.models.fields.DateTimeField', [], {}),
158
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
159
            'last_approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
160
            'members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosUser']", 'through': "orm['im.ProjectMembership']", 'symmetrical': 'False'}),
161
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80', 'db_index': 'True'}),
162
            'termination_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
163
            'termination_start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'})
164
        },
165
        'im.projectapplication': {
166
            'Meta': {'object_name': 'ProjectApplication'},
167
            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_applied'", 'to': "orm['im.AstakosUser']"}),
168
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
169
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
170
            'end_date': ('django.db.models.fields.DateTimeField', [], {}),
171
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
172
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
173
            'issue_date': ('django.db.models.fields.DateTimeField', [], {}),
174
            'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
175
            'member_join_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberJoinPolicy']"}),
176
            'member_leave_policy': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.MemberLeavePolicy']"}),
177
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
178
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_owned'", 'to': "orm['im.AstakosUser']"}),
179
            'precursor_application': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['im.ProjectApplication']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
180
            'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}),
181
            'start_date': ('django.db.models.fields.DateTimeField', [], {}),
182
            'state': ('django.db.models.fields.CharField', [], {'default': "'Unknown'", 'max_length': '80'})
183
        },
184
        'im.projectmembership': {
185
            'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembership'},
186
            'acceptance_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_index': 'True'}),
187
            'application': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'memberships'", 'null': 'True', 'to': "orm['im.ProjectApplication']"}),
188
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
189
            'leave_request_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
190
            'pending_application': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pending_memebrships'", 'null': 'True', 'to': "orm['im.ProjectApplication']"}),
191
            'pending_serial': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'db_index': 'True'}),
192
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
193
            'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
194
            'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2012, 12, 28, 11, 55, 39, 190907)'}),
195
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0'})
196
        },
197
        'im.projectmembershiphistory': {
198
            'Meta': {'object_name': 'ProjectMembershipHistory'},
199
            'date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now'}),
200
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
201
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
202
            'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
203
            'reason': ('django.db.models.fields.IntegerField', [], {}),
204
            'serial': ('django.db.models.fields.BigIntegerField', [], {})
205
        },
206
        'im.projectresourcegrant': {
207
            'Meta': {'unique_together': "(('resource', 'project_application'),)", 'object_name': 'ProjectResourceGrant'},
208
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
209
            'member_capacity': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
210
            'member_export_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
211
            'member_import_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
212
            'project_application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.ProjectApplication']", 'null': 'True'}),
213
            'project_capacity': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
214
            'project_export_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
215
            'project_import_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
216
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"})
217
        },
218
        'im.resource': {
219
            'Meta': {'unique_together': "(('name', 'service'),)", 'object_name': 'Resource'},
220
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
221
            'group': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
222
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
223
            'meta': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.ResourceMetadata']", 'symmetrical': 'False'}),
224
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
225
            'service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Service']"}),
226
            'unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'})
227
        },
228
        'im.resourcemetadata': {
229
            'Meta': {'object_name': 'ResourceMetadata'},
230
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
231
            'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
232
            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
233
        },
234
        'im.serial': {
235
            'Meta': {'object_name': 'Serial'},
236
            'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
237
        },
238
        'im.service': {
239
            'Meta': {'object_name': 'Service'},
240
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
241
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
242
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
243
            'icon': ('django.db.models.fields.FilePathField', [], {'max_length': '100', 'blank': 'True'}),
244
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
245
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
246
            'url': ('django.db.models.fields.FilePathField', [], {'max_length': '100'})
247
        },
248
        'im.sessioncatalog': {
249
            'Meta': {'object_name': 'SessionCatalog'},
250
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
251
            'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
252
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'null': 'True', 'to': "orm['im.AstakosUser']"})
253
        }
254
    }
255

  
256
    complete_apps = ['im']

Also available in: Unified diff