Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
More 2/3 work
Browse files Browse the repository at this point in the history
  • Loading branch information
vegitron committed May 1, 2015
1 parent a1e3dab commit 92da597
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions sqlshare_rest/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import json
from sqlshare_rest.util.queue_triggers import trigger_query_queue_processing
import uuid
import six
from six import add_metaclass
# from django_fields.fields import EncryptedCharField

Expand Down Expand Up @@ -255,15 +256,26 @@ def parser_json_data(self):
}


# Python3 shims.
@add_metaclass(models.SubfieldBase)
class Py3FlowField(FlowField):
pass
if six.PY3:
# Python3 shims.
# Still need to use add_metaclass, so the python2 parser doesn't break
# on metaclass=...

# But - in python2 this breaks. so double shimmed.
@add_metaclass(models.SubfieldBase)
class Py3FlowField(FlowField):
pass

@add_metaclass(models.SubfieldBase)
class Py3CredentialsField(CredentialsField):
pass
@add_metaclass(models.SubfieldBase)
class Py3CredentialsField(CredentialsField):
pass

if six.PY2:
class Py3FlowField(FlowField):
pass

class Py3CredentialsField(CredentialsField):
pass


# These are for the google logins
Expand Down

0 comments on commit 92da597

Please sign in to comment.