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 8a034c6Copy full SHA for 8a034c6
pylint_django/tests/input/func_noerror_generic_foreign_key.py
@@ -0,0 +1,17 @@
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
+ # for #230 the important bit is this FK field which doesn't
14
+ # have any keyword arguments!
15
+ owner_type = models.ForeignKey(ContentType, models.CASCADE)
16
+ owner_id = models.PositiveIntegerField()
17
+ owner = GenericForeignKey("owner_type", "owner_id")
0 commit comments