#15839: search_fields: duplicated search results when following relationships
"backward"
---------------------------+------------------------------
 Reporter:  while0pass     |         Owner:  nobody
     Type:  Uncategorized  |        Status:  new
Milestone:                 |     Component:  contrib.admin
  Version:  1.3            |      Severity:  Normal
 Keywords:                 |  Triage Stage:  Unreviewed
Has patch:  0              |
---------------------------+------------------------------
 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')
   ...
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/15839>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to