﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
31498	"GenericRelation's get_internal_type() incorrectly reports ""ManyToManyField""."	George Dorn	nobody	"I have two models, one containing a GFK to the other (and presumably others models).

{{{
#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python

class Example(models.Model):
    text = models.TextField()
    example_gfk = GenericRelation(
        ""myapp.ExampleGFK"",
        related_query_name=""example"",
    )

class ExampleGFK(Bulkable):
    text = models.TextField()
    content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
    object_id = models.PositiveIntegerField()
    content = GenericForeignKey(""content_type"", ""object_id"")
  }}}
}}}

When I inspect `Example._meta.get_field('example_gfk').get_internal_type()`, it reports it is a `ManyToManyField`.  This can't be right, though; as a reverse relationship, it should be a `ManyToOneRel`; a single `ExampleGFK` can't be related to more than one `Example` object.

Perhaps there's a solid reason for this that eludes me, like it tricks some part of the admin or other part of the ORM to behave correctly.  If so, at the very least a note in the documentation or a docstring in the code could clarify that reason."	Bug	new	contrib.contenttypes	3.0	Normal				Unreviewed	0	0	0	0	0	0
