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

Implementing `@python_2_unicode_compatible` should be done at class definition #88

Closed opbod closed 9 years ago

opbod commented 9 years ago

When I try to implement @python_2_unicode_compatible at the __str__ method as per p207, I get:

ValueError: @python_2_unicode_compatible cannot be applied to __str__ because it doesn't define __str__().

It looks like @python_2_unicode_compatible needs to be placed right above the class definition and not the __str__.

I'm using Django 1.7.1 and Python 2.7.

HassenPy commented 9 years ago

Can you tell me how incompatible is the book with Django 1.7.1, since it's using Django 1.6, or at least if you had any compatibility hard times.

pydanny commented 9 years ago

This is a duplicate of #61.

@HassenPy - The book is about 95% compatible with Django 1.7.

HassenPy commented 9 years ago

thanks @pydanny