Skip to content
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

Model decorator python_2_unicode_compatible not recogised, warns missing unicode method #10

Closed
llnz opened this issue Apr 10, 2014 · 2 comments

Comments

@llnz
Copy link

llnz commented Apr 10, 2014

The model decorater @python_2_unicode_compatible can be used to turn a __str__ method return a unicode string (py2 unicode, py3 string) into the required __unicode__ on python 2.

pylint-django currently gives the message [W5101] No __unicode__ method on model (ModelName) for a class like:

@python_2_unicode_compatible
class ModelName(models.Model):
    name = models.CharField(max_length=200)

    def __str__(self):
        return self.name

See the Django Python 3 porting guide for details: https://docs.djangoproject.com/en/1.6/topics/python3/#str-and-unicode-methods

carlio added a commit that referenced this issue Sep 14, 2014
…Django python3/2 compatability decorator is used
@carlio
Copy link
Collaborator

carlio commented Sep 14, 2014

Finally fixed, it'll be available as part of the 0.5 release soon!

@carlio carlio closed this as completed Sep 14, 2014
@llnz
Copy link
Author

llnz commented Sep 14, 2014

Great. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants