ticket #28384 question

98 views
Skip to first unread message

Windson Yang

unread,
Sep 7, 2017, 2:25:12 AM9/7/17
to Django developers (Contributions to Django itself)
This problem actually in

option.py 
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 

 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?

Windson Yang

unread,
Sep 11, 2017, 12:59:37 AM9/11/17
to Django developers (Contributions to Django itself)
Any suggestions? Or I miss something here?

在 2017年9月7日星期四 UTC+8下午2:25:12,Windson Yang写道:

Tim Graham

unread,
Sep 11, 2017, 2:01:06 PM9/11/17
to Django developers (Contributions to Django itself)
The question seems difficult to answer without writing the patch to understand it.
Reply all
Reply to author
Forward
0 new messages