File: func_noerror_model_unicode_callable.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 (15 lines) | stat: -rw-r--r-- 350 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"""
Ensures that django models without a __unicode__ method are flagged
"""
#  pylint: disable=missing-docstring,wrong-import-position

from django.db import models


def external_unicode_func(model):
    return model.something


class SomeModel(models.Model):
    something = models.CharField(max_length=255)
    __unicode__ = external_unicode_func