File: func_noerror_foreign_key_package.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 (13 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
"""
Checks that Pylint does not complain about ForeignKey pointing to model
in module of models package
"""
# pylint: disable=missing-docstring
from django.db import models


class Book(models.Model):
    author = models.ForeignKey(to='input.Author', on_delete=models.CASCADE)

    def get_author_name(self):
        return self.author.id