Statistics
| Branch: | Tag: | Revision:

root / snf-astakos-app / astakos / im / migrations / 0016_auth_providers_and_projects.py @ 3c41f3ef

History | View | Annotate | Download (25.4 kB)

1
# encoding: utf-8
2
import datetime
3
import uuid
4

    
5
from south.db import db
6
from south.v2 import DataMigration
7
from django.db import models
8
from django.core.validators import email_re
9

    
10
from django.conf import settings
11

    
12
class Migration(DataMigration):
13

    
14
    def forwards(self, orm):
15
        # valid activation_sent/email_verified
16
        for user in orm.AstakosUser.objects.filter(is_active=True):
17
            if not user.activation_sent:
18
                user.activation_sent = datetime.datetime.now()
19
                user.email_verified = True
20
                user.save()
21

    
22
            while not user.uuid:
23
                uuid_val =  str(uuid.uuid4())
24
                try:
25
                    orm.AstakosUser.objects.get(uuid=uuid_val)
26
                except orm.AstakosUser.DoesNotExist, e:
27
                    user.uuid = uuid_val
28
                    user.save()
29

    
30
        # migrate to auth providers
31
        for user in orm.AstakosUser.objects.all():
32
            if user.provider and user.provider != 'local':
33
                orm.AstakosUserAuthProvider.objects.create(user=user,
34
                                                           module=user.provider,
35
                                                           identifier=user.third_party_identifier)
36
            else:
37
                orm.AstakosUserAuthProvider.objects.create(user=user,
38
                                                           module='local',
39
                                                           auth_backend='astakos')
40

    
41
            user.save()
42

    
43
        # migrate duplicate emails
44
        to_remove = getattr(settings,
45
                            'ASTAKOS_MIGRATION_0045_DELETE_DUPLICATE_USER_IDS',
46
                            [])
47
        for pk in to_remove:
48
            try:
49
                u = orm.AstakosUser.objects.get(pk=int(pk))
50
                print "Removing user: %s (%d)" % (u.email, u.pk)
51
            except Exception:
52
                msg = "You requested user with id %s to be removed but such user doesn't exist in database" % str(pk)
53
                raise Exception(msg)
54

    
55
            if orm.AstakosUser.objects.filter(email__iexact=u.email).count() == 1:
56
                msg = ("You requested user with duplicate email %s and id (%d) to"
57
                " be removed, but it seems that only one user exists with this"
58
                " email in the database.") % (u.email , pk)
59
                raise Exception(msg)
60
            else:
61
                orm.AstakosUser.objects.filter(pk=int(pk)).delete()
62

    
63
        for u in orm.AstakosUser.objects.all():
64
            if orm.AstakosUser.objects.filter(email__iexact=u.email).count() > 1:
65
                existing = orm.AstakosUser.objects.filter(
66
                                email__iexact=u.email)
67
                print "Duplicate email found in database"
68
                for e in existing:
69
                    print "%d: %s (is_active: %s)" % (e.pk, e.email, e.is_active)
70
                keep = input("Select which user id you want to BE PRESERVED in the database: ")
71
                if keep:
72
                    for e in existing.exclude(pk=int(keep)):
73
                        e.delete()
74
                else:
75
                    raise Exception("Email %s is not unique %r. Please resolve conflicts and run migrate again." % (u.email,
76
                                                                 existing))
77
            u = orm.AstakosUser.objects.get(email__iexact=u.email)
78
            save = False
79
            if not email_re.match(u.username):
80
                u.username = u.email.lower()
81
                save = True
82
            if save:
83
                u.save()
84

    
85

    
86
    def backwards(self, orm):
87
        # set third_party_identifier
88
        for user in orm.AstakosUser.objects.all():
89
            for auth_provider in user.auth_providers.all():
90
                user.provider = auth_provider.module
91
                user.third_party_identifier = auth_provider.identifier
92

    
93
            user.save()
94

    
95
        # reset usernames
96
        for u in orm.AstakosUser.objects.all():
97
            u.uuid = None
98
            if email_re.match(u.username):
99
                username = None
100
                while not username:
101
                    username_val = uuid.uuid4().hex[:30]
102
                    try:
103
                        orm.AstakosUser.objects.get(username = username_val)
104
                    except orm.AstakosUser.DoesNotExist, e:
105
                        username = username_val
106
                u.username = username
107
            u.save()
108

    
109

    
110
    models = {
111
        'auth.group': {
112
            'Meta': {'object_name': 'Group'},
113
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
114
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
115
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
116
        },
117
        'auth.permission': {
118
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
119
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
120
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
121
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
122
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
123
        },
124
        'auth.user': {
125
            'Meta': {'object_name': 'User'},
126
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
127
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
128
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
129
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
130
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
131
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
132
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
133
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
134
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
135
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
136
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
137
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
138
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
139
        },
140
        'contenttypes.contenttype': {
141
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
142
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
143
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
144
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
145
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
146
        },
147
        'im.additionalmail': {
148
            'Meta': {'object_name': 'AdditionalMail'},
149
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
150
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
151
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
152
        },
153
        'im.approvalterms': {
154
            'Meta': {'object_name': 'ApprovalTerms'},
155
            'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 11, 14, 22, 49, 523700)', 'db_index': 'True'}),
156
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
157
            'location': ('django.db.models.fields.CharField', [], {'max_length': '255'})
158
        },
159
        'im.astakosuser': {
160
            'Meta': {'object_name': 'AstakosUser', '_ormbases': ['auth.User']},
161
            'activation_sent': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
162
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
163
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
164
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
165
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
166
            'date_signed_terms': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
167
            'disturbed_quota': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
168
            'email_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
169
            'has_credits': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
170
            'has_signed_terms': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
171
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
172
            'is_verified': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
173
            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
174
            'policy': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.AstakosUserQuota']", 'symmetrical': 'False'}),
175
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
176
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
177
            'updated': ('django.db.models.fields.DateTimeField', [], {}),
178
            'user_ptr': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True', 'primary_key': 'True'}),
179
            'uuid': ('django.db.models.fields.CharField', [], {'max_length': '255', 'unique': 'True', 'null': 'True'})
180
        },
181
        'im.astakosuserauthprovider': {
182
            'Meta': {'ordering': "('module', 'created')", 'unique_together': "(('identifier', 'module', 'user'),)", 'object_name': 'AstakosUserAuthProvider'},
183
            'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
184
            'affiliation': ('django.db.models.fields.CharField', [], {'default': 'None', 'max_length': '255', 'null': 'True', 'blank': 'True'}),
185
            'auth_backend': ('django.db.models.fields.CharField', [], {'default': "'astakos'", 'max_length': '255'}),
186
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
187
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
188
            'identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
189
            'info_data': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
190
            'module': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '255'}),
191
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'auth_providers'", 'to': "orm['im.AstakosUser']"})
192
        },
193
        'im.astakosuserquota': {
194
            'Meta': {'unique_together': "(('resource', 'user'),)", 'object_name': 'AstakosUserQuota'},
195
            'capacity': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
196
            'export_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
197
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
198
            'import_limit': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
199
            'quantity': ('django.db.models.fields.BigIntegerField', [], {'null': 'True'}),
200
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"}),
201
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"})
202
        },
203
        'im.chain': {
204
            'Meta': {'object_name': 'Chain'},
205
            'chain': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
206
        },
207
        'im.emailchange': {
208
            'Meta': {'object_name': 'EmailChange'},
209
            'activation_key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '40', 'db_index': 'True'}),
210
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
211
            'new_email_address': ('django.db.models.fields.EmailField', [], {'max_length': '75'}),
212
            'requested_at': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2013, 1, 11, 14, 22, 49, 524502)'}),
213
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'emailchanges'", 'unique': 'True', 'to': "orm['im.AstakosUser']"})
214
        },
215
        'im.invitation': {
216
            'Meta': {'object_name': 'Invitation'},
217
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
218
            'consumed': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
219
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
220
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
221
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.AstakosUser']"}),
222
            'is_consumed': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
223
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
224
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
225
        },
226
        'im.pendingthirdpartyuser': {
227
            'Meta': {'unique_together': "(('provider', 'third_party_identifier'),)", 'object_name': 'PendingThirdPartyUser'},
228
            'affiliation': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
229
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
230
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
231
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
232
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
233
            'info': ('django.db.models.fields.TextField', [], {'default': "''", 'null': 'True', 'blank': 'True'}),
234
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True', 'blank': 'True'}),
235
            'provider': ('django.db.models.fields.CharField', [], {'max_length': '255', 'blank': 'True'}),
236
            'third_party_identifier': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
237
            'token': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
238
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
239
        },
240
        'im.project': {
241
            'Meta': {'object_name': 'Project'},
242
            'application': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "'project'", 'unique': 'True', 'to': "orm['im.ProjectApplication']"}),
243
            'creation_date': ('django.db.models.fields.DateTimeField', [], {}),
244
            'deactivation_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
245
            'deactivation_reason': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
246
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
247
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'db_index': 'True'}),
248
            'is_modified': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
249
            'last_approval_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
250
            'members': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.AstakosUser']", 'through': "orm['im.ProjectMembership']", 'symmetrical': 'False'}),
251
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80', 'db_index': 'True'}),
252
            'state': ('django.db.models.fields.IntegerField', [], {'default': '1', 'db_index': 'True'})
253
        },
254
        'im.projectapplication': {
255
            'Meta': {'unique_together': "(('chain', 'id'),)", 'object_name': 'ProjectApplication'},
256
            'applicant': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_applied'", 'to': "orm['im.AstakosUser']"}),
257
            'chain': ('django.db.models.fields.IntegerField', [], {}),
258
            'comments': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
259
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
260
            'end_date': ('django.db.models.fields.DateTimeField', [], {}),
261
            'homepage': ('django.db.models.fields.URLField', [], {'max_length': '255', 'null': 'True'}),
262
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
263
            'issue_date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
264
            'limit_on_members_number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
265
            'member_join_policy': ('django.db.models.fields.IntegerField', [], {}),
266
            'member_leave_policy': ('django.db.models.fields.IntegerField', [], {}),
267
            'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}),
268
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'projects_owned'", 'to': "orm['im.AstakosUser']"}),
269
            'precursor_application': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['im.ProjectApplication']", 'unique': 'True', 'null': 'True', 'blank': 'True'}),
270
            'resource_grants': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['im.Resource']", 'null': 'True', 'through': "orm['im.ProjectResourceGrant']", 'blank': 'True'}),
271
            'start_date': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
272
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0'})
273
        },
274
        'im.projectmembership': {
275
            'Meta': {'unique_together': "(('person', 'project'),)", 'object_name': 'ProjectMembership'},
276
            'acceptance_date': ('django.db.models.fields.DateField', [], {'null': 'True', 'db_index': 'True'}),
277
            'application': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'memberships'", 'null': 'True', 'to': "orm['im.ProjectApplication']"}),
278
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
279
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
280
            'is_pending': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'db_index': 'True'}),
281
            'leave_request_date': ('django.db.models.fields.DateField', [], {'null': 'True'}),
282
            'pending_application': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'pending_memebrships'", 'null': 'True', 'to': "orm['im.ProjectApplication']"}),
283
            'pending_serial': ('django.db.models.fields.BigIntegerField', [], {'null': 'True', 'db_index': 'True'}),
284
            'person': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.AstakosUser']"}),
285
            'project': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Project']"}),
286
            'request_date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime(2013, 1, 11, 14, 22, 49, 528323)'}),
287
            'state': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'})
288
        },
289
        'im.projectmembershiphistory': {
290
            'Meta': {'object_name': 'ProjectMembershipHistory'},
291
            'date': ('django.db.models.fields.DateField', [], {'default': 'datetime.datetime.now'}),
292
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
293
            'person': ('django.db.models.fields.BigIntegerField', [], {}),
294
            'project': ('django.db.models.fields.BigIntegerField', [], {}),
295
            'reason': ('django.db.models.fields.IntegerField', [], {}),
296
            'serial': ('django.db.models.fields.BigIntegerField', [], {})
297
        },
298
        'im.projectresourcegrant': {
299
            'Meta': {'unique_together': "(('resource', 'project_application'),)", 'object_name': 'ProjectResourceGrant'},
300
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
301
            'member_capacity': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
302
            'member_export_limit': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
303
            'member_import_limit': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
304
            'project_application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.ProjectApplication']", 'null': 'True'}),
305
            'project_capacity': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
306
            'project_export_limit': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
307
            'project_import_limit': ('synnefo.lib.db.intdecimalfield.IntDecimalField', [], {'default': '100000000000000000000000000000000L', 'max_digits': '38', 'decimal_places': '0'}),
308
            'resource': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Resource']"})
309
        },
310
        'im.resource': {
311
            'Meta': {'unique_together': "(('name', 'service'),)", 'object_name': 'Resource'},
312
            'desc': ('django.db.models.fields.TextField', [], {'null': 'True'}),
313
            'group': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
314
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
315
            'meta': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['im.ResourceMetadata']", 'symmetrical': 'False'}),
316
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
317
            'service': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['im.Service']"}),
318
            'unit': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'})
319
        },
320
        'im.resourcemetadata': {
321
            'Meta': {'object_name': 'ResourceMetadata'},
322
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
323
            'key': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
324
            'value': ('django.db.models.fields.CharField', [], {'max_length': '255'})
325
        },
326
        'im.serial': {
327
            'Meta': {'object_name': 'Serial'},
328
            'serial': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
329
        },
330
        'im.service': {
331
            'Meta': {'ordering': "('order',)", 'object_name': 'Service'},
332
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
333
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
334
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
335
            'icon': ('django.db.models.fields.FilePathField', [], {'max_length': '100', 'blank': 'True'}),
336
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
337
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255', 'db_index': 'True'}),
338
            'order': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
339
            'url': ('django.db.models.fields.FilePathField', [], {'max_length': '100'})
340
        },
341
        'im.sessioncatalog': {
342
            'Meta': {'object_name': 'SessionCatalog'},
343
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
344
            'session_key': ('django.db.models.fields.CharField', [], {'max_length': '40'}),
345
            'user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'sessions'", 'null': 'True', 'to': "orm['im.AstakosUser']"})
346
        }
347
    }
348

    
349
    complete_apps = ['im']