File: func_model_does_not_use_unicode_py33.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 (19 lines) | stat: -rw-r--r-- 405 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
"""
Ensures that under PY3 django models with a __unicode__ method are flagged
"""
#  pylint: disable=missing-docstring

from django.db import models


class SomeModel(models.Model):  # [model-has-unicode]
    something = models.CharField(max_length=255)
    # no __str__ method

    something.something_else = 1

    def lala(self):
        pass

    def __unicode__(self):
        return self.something