You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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:See the Django Python 3 porting guide for details: https://docs.djangoproject.com/en/1.6/topics/python3/#str-and-unicode-methods
The text was updated successfully, but these errors were encountered: