﻿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
15839	"search_fields: duplicated search results when following relationships ""backward"""	while0pass	nobody	"If in search_fields one uses both fields of a model A and a model B related to A as many to one (B has a foreign key field to A), search results for A-objects may contain multiple occurrence of the same A-object.

Example code:


{{{
# models.py
class DictionaryEntry(models.Model):
  ...
  transcription = models.CharField(...)
  ...

class OrthographicVariant(models.Model):
  entry = models.ForeignKey(DictionaryEntry, related_name='orthvars')
  orthvar = models.CharField(...)
  ... 
}}}
{{{
# admin.py
class AdminDictEntry(admin.ModelAdmin):
  ...
  search_fields = ('transcription', 'orthvars__orthvar')
  ...
}}}
"	Bug	closed	contrib.admin	1.3	Normal	duplicate			Unreviewed	0	0	0	0	0	0
