Earlier I fixed bug #27897 <https://code.djangoproject.com/ticket/27897> that resulted in a crash when the field name 'pk' was used in an admin search filter. The fix was to special case the check for 'pk' before calling `.get_field`. Afterwards I grepped through the code base and found 3 or 4 other places with the same special casing. To me, this annotation requirement indicates that the `.get_field` abstraction is broken and thus the ticket.
During the subsequent discussion on the PR <https://github.com/django/django/pull/8191/> Simon & Tim both expressed that they are worried about subtle bugs in the ORM this change might introduce. I'm not familiar enough with that code to offer my opinion although I did trace how a model is set up at the current moment to prove to myself that only in the accurate case of an abstract model sans a primary_key definition would .pk be None. The recommendation was to post here on the mailing list to gather feedback. -- 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/f6d74bf1-22c7-42cf-b47c-1dbe2882b2cb%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
