Skip to content
This repository was archived by the owner on Feb 18, 2019. It is now read-only.
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
3 changes: 2 additions & 1 deletion json_field.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import json

from django.db import models
from django.utils import simplejson as json
from django.core.serializers.json import DjangoJSONEncoder


Expand Down
6 changes: 1 addition & 5 deletions safe_django_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,4 @@ def monkeypatch():
)

for cls in classes:
bases = list(cls.__bases__)
if django.utils.encoding.StrAndUnicode in bases:
idx = bases.index(django.utils.encoding.StrAndUnicode)
bases[idx] = SafeStrAndUnicode
cls.__bases__ = tuple(bases)
cls.__html__ = lambda self: unicode(self)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this also work on Django 1.4 and 1.5?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what uses those? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a 3rd party app that could be included in projects that use older Django versions, this patch should consider it. Django 1.4 especially is a long-term support release and many people will stay on it for awhile.