#26979: Using an admin.RelatedOnlyFieldListFilter in admin does not working if a
type of a field is ForeignKey and value to_field is not pk (in my case it
is UUID).
-------------------------------------+-------------------------------------
     Reporter:  setivolkylany        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.admin        |                  Version:  1.9
     Severity:  Normal               |               Resolution:  needsinfo
     Keywords:  Admin, ForeignKey,   |             Triage Stage:
  models                             |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by setivolkylany):

 Replying to [comment:4 timgraham]:
 > After 815f4d206dfea41bdff167283c2cac43a71524ac, the sample project shows
 "Cannot find 'comment' on Utility object, 'comment' is an invalid
 parameter to prefetch_related()".

 Sorry, but this commit related with a Django`s version 1.10, I am using
 the 1.9.7 (if you see requirements.txt).

 The problem is in a field models.UUIDField, because with a field
 models.AutoField() all working properly (I am tested it)

 Thus, please explain me, how "Added support for "__" lookup in
 RelatedOnlyFieldList" is related with UUIDField

 Second, I had mistake in code (I corrected it in new commit)

 Instead of

 {{{
 qs = qs.prefetch_related('comment')
 }}}

 must be

 {{{
 qs = qs.prefetch_related('comments')
 }}}


 Thirdly
 In real projects I am using PostgreSQL, no SQLite. But, I think it is not
 have sense for this problem.

--
Ticket URL: <https://code.djangoproject.com/ticket/26979#comment:5>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/071.83bb7f6f39f9326791bb08c2198cfca5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to