Skip to content

FIX-ERROR: ImportError: cannot import name 'force_unicode' from 'djan… #33

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion django_remote_forms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = 'Carlo Costino, Tareque Hossain'
__version__ = (0, 0, 1)
__version__ = (0, 0, 2)

import logging

Expand Down
2 changes: 1 addition & 1 deletion django_remote_forms/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def as_dict(self):
try:
remote_widget_class = getattr(widgets, remote_widget_class_name)
remote_widget = remote_widget_class(self.field.widget, field_name=self.field_name)
except Exception, e:
except Exception as e:
logger.warning('Error serializing %s: %s', remote_widget_class_name, str(e))
widget_dict = {}
else:
Expand Down
2 changes: 1 addition & 1 deletion django_remote_forms/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def as_dict(self):
try:
remote_field_class = getattr(fields, remote_field_class_name)
remote_field = remote_field_class(field, form_initial_field_data, field_name=name)
except Exception, e:
except Exception as e:
logger.warning('Error serializing field %s: %s', remote_field_class_name, str(e))
field_dict = {}
else:
Expand Down
6 changes: 5 additions & 1 deletion django_remote_forms/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
from django.utils.functional import Promise
from django.utils.encoding import force_unicode

try:
from django.utils.encoding import force_unicode # Django in Python 2
except ImportError:
from django.utils.encoding import force_text as force_unicode # Django in Python 3


def resolve_promise(o):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='django-remote-forms',
version='0.0.1',
version='0.0.2',
description='A platform independent form serializer for Django.',
author='WiserTogether Tech Team',
author_email='[email protected]',
Expand Down