Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allows mongo inherits when unicode_literals #48

Open
wants to merge 2 commits into
base: gisce
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion osv_mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from osv.osv import module_class_list, module_list, class_pool
from . import orm_mongodb

import six

class osv_mongodb(orm_mongodb.orm_mongodb):
#__metaclass__ = inheritor
Expand Down Expand Up @@ -63,6 +63,8 @@ def createInstance(cls, pool, module, cr):
if cls in parent_class.mro():
cls = parent_class
else:
if six.PY2 and isinstance(name, six.text_type):
name = six.binary_type(name)
cls = type(name, (cls, parent_class), nattr)
obj = object.__new__(cls)
obj.__init__(pool, cr)
Expand Down
Loading