twoscoops / two-scoops-of-django-1.6

Tracking thoughts and feature requests for Two Scoops of Django 1.6
51 stars 7 forks source link

Page 207: Example 17.1 python_2_unicode_compatible should be applied to the class #43

Closed dfolland closed 9 years ago

dfolland commented 10 years ago

https://github.com/django/django/blob/stable/1.6.x/django/utils/encoding.py

The comments state to "apply this decorator the the class.".

I've found that if you apply to the __str() method you get this error:

@python_2_unicode_compatible cannot be applied to str because it doesn't define str().

gglentini commented 10 years ago

I came across the same the same error, indeed I fixed the error applying the decorator to the class ;-)