11
11
else :
12
12
User = get_user_model ()
13
13
14
+ from oauth2_provider .models import get_application_model
15
+ ApplicationModel = get_application_model ()
16
+
14
17
15
18
class Migration (SchemaMigration ):
16
19
@@ -33,7 +36,7 @@ def forwards(self, orm):
33
36
(u'id' , self .gf ('django.db.models.fields.AutoField' )(primary_key = True )),
34
37
('user' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % (User ._meta .app_label , User ._meta .object_name )])),
35
38
('code' , self .gf ('django.db.models.fields.CharField' )(max_length = 255 )),
36
- ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ['oauth2_provider.Application' ])),
39
+ ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) ])),
37
40
('expires' , self .gf ('django.db.models.fields.DateTimeField' )()),
38
41
('redirect_uri' , self .gf ('django.db.models.fields.CharField' )(max_length = 255 )),
39
42
('scope' , self .gf ('django.db.models.fields.TextField' )(blank = True )),
@@ -45,7 +48,7 @@ def forwards(self, orm):
45
48
(u'id' , self .gf ('django.db.models.fields.AutoField' )(primary_key = True )),
46
49
('user' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % (User ._meta .app_label , User ._meta .object_name )])),
47
50
('token' , self .gf ('django.db.models.fields.CharField' )(max_length = 255 )),
48
- ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ['oauth2_provider.Application' ])),
51
+ ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) ])),
49
52
('expires' , self .gf ('django.db.models.fields.DateTimeField' )()),
50
53
('scope' , self .gf ('django.db.models.fields.TextField' )(blank = True )),
51
54
))
@@ -56,7 +59,7 @@ def forwards(self, orm):
56
59
(u'id' , self .gf ('django.db.models.fields.AutoField' )(primary_key = True )),
57
60
('user' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % (User ._meta .app_label , User ._meta .object_name )])),
58
61
('token' , self .gf ('django.db.models.fields.CharField' )(max_length = 255 )),
59
- ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ['oauth2_provider.Application' ])),
62
+ ('application' , self .gf ('django.db.models.fields.related.ForeignKey' )(to = orm ["%s.%s" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) ])),
60
63
('access_token' , self .gf ('django.db.models.fields.related.OneToOneField' )(related_name = 'refresh_token' , unique = True , to = orm ['oauth2_provider.AccessToken' ])),
61
64
))
62
65
db .send_create_signal (u'oauth2_provider' , ['RefreshToken' ])
@@ -115,15 +118,15 @@ def backwards(self, orm):
115
118
},
116
119
u'oauth2_provider.accesstoken' : {
117
120
'Meta' : {'object_name' : 'AccessToken' },
118
- 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['oauth2_provider.Application ']" }),
121
+ 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['%s.%s ']" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) }),
119
122
'expires' : ('django.db.models.fields.DateTimeField' , [], {}),
120
123
u'id' : ('django.db.models.fields.AutoField' , [], {'primary_key' : 'True' }),
121
124
'scope' : ('django.db.models.fields.TextField' , [], {'blank' : 'True' }),
122
125
'token' : ('django.db.models.fields.CharField' , [], {'max_length' : '255' }),
123
126
'user' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['%s.%s']" % (User ._meta .app_label , User ._meta .object_name )})
124
127
},
125
- u'oauth2_provider.application' : {
126
- 'Meta' : {'object_name' : 'Application' },
128
+ u"%s.%s" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) : {
129
+ 'Meta' : {'object_name' : ApplicationModel . __name__ },
127
130
'authorization_grant_type' : ('django.db.models.fields.CharField' , [], {'max_length' : '32' }),
128
131
'client_id' : ('django.db.models.fields.CharField' , [], {'default' : "'30f17d266183cd455bc57ce8548a439db3491353'" , 'unique' : 'True' , 'max_length' : '100' }),
129
132
'client_secret' : ('django.db.models.fields.CharField' , [], {'default' : "'18e68df61ad8e1af355644ddf6a636b269b6309aafbd2a34d4f5ed6c5562e44c0792c5b2441571e85cbf8a85249dca5537dedb6fd6f60e134f4a60f3865c8395'" , 'max_length' : '255' , 'blank' : 'True' }),
@@ -135,7 +138,7 @@ def backwards(self, orm):
135
138
},
136
139
u'oauth2_provider.grant' : {
137
140
'Meta' : {'object_name' : 'Grant' },
138
- 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['oauth2_provider.Application ']" }),
141
+ 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['%s.%s ']" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) }),
139
142
'code' : ('django.db.models.fields.CharField' , [], {'max_length' : '255' }),
140
143
'expires' : ('django.db.models.fields.DateTimeField' , [], {}),
141
144
u'id' : ('django.db.models.fields.AutoField' , [], {'primary_key' : 'True' }),
@@ -146,7 +149,7 @@ def backwards(self, orm):
146
149
u'oauth2_provider.refreshtoken' : {
147
150
'Meta' : {'object_name' : 'RefreshToken' },
148
151
'access_token' : ('django.db.models.fields.related.OneToOneField' , [], {'related_name' : "'refresh_token'" , 'unique' : 'True' , 'to' : u"orm['oauth2_provider.AccessToken']" }),
149
- 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['oauth2_provider.Application ']" }),
152
+ 'application' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['%s.%s ']" % ( ApplicationModel . _meta . app_label , ApplicationModel . _meta . object_name ) }),
150
153
u'id' : ('django.db.models.fields.AutoField' , [], {'primary_key' : 'True' }),
151
154
'token' : ('django.db.models.fields.CharField' , [], {'max_length' : '255' }),
152
155
'user' : ('django.db.models.fields.related.ForeignKey' , [], {'to' : u"orm['%s.%s']" % (User ._meta .app_label , User ._meta .object_name )})
0 commit comments