jazzband / django-mongonaut

Built from scratch to replicate some of the Django admin functionality and add some more, to serve as an introspective interface for Django and Mongo.
MIT License
240 stars 67 forks source link

UnicodeEncodeError in mongonaut_tags #79

Open lchsk opened 9 years ago

lchsk commented 9 years ago

In mongonaut_tags.py there are two similar lines:

(1) return mark_safe("""<a href="{0}">{1}</a>""".format(value, value)) (2) return mark_safe("""<a href="{0}">{1}</a>""".format(url, value.__unicode__()))

Is there a reason for using .__unicode__() in (2)? (It gives me me UnicodeEncodeError on a string that includes unicode characters. Removing .__unicode__() seems to help.)

Cheers

garrypolley commented 9 years ago

I'm not entirely sure at the moment if there is a technical reason they are different.

this was the newer of the two: https://github.com/pydanny/django-mongonaut/commit/0a7320269064fc4a1602987e6f320fb72b34046e

garrypolley commented 9 years ago

Assuming it doesn't break anything I'm cool with a change to not call .__unicode__

lchsk commented 9 years ago

I removed .__unicode__ in my local version for the project I'm currently developing. It did not break anything for what I can observe. I can prepare a pull request later.