class name must be string and not unicode

The class name in reference could be unicode but type accept only string as
name.

review724002
This commit is contained in:
Cédric Krier committed 2013-03-22 17:40:15 +01:00
1 parent 183b99ce71
commit b191423d69
1 file changed
+3
+3
View File
@@ -596,6 +596,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