﻿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
25354	Can't use related_query_name on an abstract base class	James Pulec	nobody	"It currently isn't possible to set related_query_name on a field on an abstract base class using the ""%(class)s"" or ""%(app_label)s"" string formatting syntax that is allowed for the related_name parameter of field. This is particularly problematic when trying to define an abstract base class that uses a GenericRelation, since you can't specify a related_name, but can specify a related_query_name.
For Example:
{{{
#!div style=""font-size: 80%""
Code highlighting:
  {{{#!python

class Child(models.Model):
    object_id = PositiveIntegerField()
    content_type = ForeignKey(ContentType)
    content_object = GenericForeignKey()


class GenericMixin(models.Model):
    relation = GenrericRelation(Child, related_query_name='%(class)s')

    class Meta:
        abstract = True


class Parent(GenericMixin):
    name = CharField()


instance = Child.objects.filter(parents__name)  # This query will not work, as 'parents' is not set as the related_query_name for the Parent Model
  }}}
}}}"	New feature	new	Database layer (models, ORM)	1.8	Normal				Unreviewed	0	0	0	0	0	0
