class name must be string and not unicode
The class name in reference could be unicode but type accept only string as name. review724002 (transplanted from c9ee01676c6b858cc2572e532f141de11e315e6c)
This commit is contained in:
1 parent
74b4bb611a
commit
c8cc00565b
1 file changed
+3
@@ -497,6 +497,9 @@ class Model(object):
|
||||
@classmethod
|
||||
def get(cls, name, config=None):
|
||||
'Get a class for the named Model'
|
||||
if isinstance(name, unicode):
|
||||
name = name.encode('utf-8')
|
||||
|
||||
class Spam(Model):
|
||||
__metaclass__ = MetaModelFactory(name, config=config)()
|
||||
return Spam
|
||||
|
||||
Reference in new issue
Block a user