We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b99f53e commit 9d55e9aCopy full SHA for 9d55e9a
pylint_django/tests/input/func_noerror_generic_foreign_key.py
@@ -0,0 +1,15 @@
1
+"""
2
+Checks that Pylint does not complain about GenericForeignKey fields:
3
+https://github.com/PyCQA/pylint-django/issues/230
4
5
+# pylint: disable=missing-docstring
6
+
7
+from django.db import models
8
+from django.contrib.contenttypes.models import ContentType
9
+from django.contrib.contenttypes.fields import GenericForeignKey
10
11
12
+class Ownership(models.Model):
13
+ owner_type = models.ForeignKey(ContentType, models.CASCADE)
14
+ owner_id = models.PositiveIntegerField()
15
+ owner = GenericForeignKey("owner_type", "owner_id")
0 commit comments