File: func_noerror_unicode_py2_compatible.py

package info (click to toggle)
pylint-django 2.0.13-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 660 kB
  • sloc: python: 1,807; sh: 13; makefile: 5
file content (17 lines) | stat: -rw-r--r-- 459 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""
Ensures that no '__unicode__ missing' warning is emitted if the
Django python3/2 compatability dectorator is used

See https://github.com/PyCQA/pylint-django/issues/10
"""
#  pylint: disable=missing-docstring
from django.utils.encoding import python_2_unicode_compatible
from django.db import models


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

    def __str__(self):
        return self.name