This problem actually in

option.py 
<https://github.com/django/django/blob/e5bd585c6eb1e13e2f8aac030b33c077b0b70c05/django/contrib/admin/options.py#L364>
 
if not prev_field or (prev_field.is_relation and
                                  field not in prev_field.get_path_info()[-1
].target_fields):
                relation_parts.append(part)
and 

related.py 
<https://github.com/django/django/blob/e5bd585c6eb1e13e2f8aac030b33c077b0b70c05/django/db/models/fields/related.py#L700>
 def get_path_info(self):
    to_opts = self.remote_field.model._meta
    from_opts = self.model._meta
    return [PathInfo(from_opts, to_opts, (to_opts.pk,), self, False, False)]


            # It is allowed to filter on values that would be found from 
local
            # model anyways. For example, if you filter on 
employee__department__id,
            # then the id value would be found already from 
employee__department_id.

I'm not sure in this situation, should we change the target_field so let it 
only focus on xxx_id instead of pk? Or we just add a condition in 
option.py  to check xxx_id or not?

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" 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].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/5249793f-be0b-4d70-bef2-6040a380b78c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to