PetrDlouhy / django-related-admin

Allow foreign key attributes in list_display with '__'
BSD 3-Clause "New" or "Revised" License
69 stars 13 forks source link

Update __init__.py #16

Open 625781186 opened 1 year ago

625781186 commented 1 year ago

admin list column name show verbose_name

PetrDlouhy commented 1 year ago

I have reworked the testing on this project to use GitHub actions. Could you please rebase this code to the current master to run the tests?

I am not sure, it in order to achieve this, we need such extensive monkey-patching. There already is getter_for_related_field which allows this to be done for individual fields much easier way. Could you please describe why this is not possible to achieve with less code copied from Django?

625781186 commented 1 year ago

I have reworked the testing on this project to use GitHub actions. Could you please rebase this code to the current master to run the tests?

I am not sure, it in order to achieve this, we need such extensive monkey-patching. There already is getter_for_related_field which allows this to be done for individual fields much easier way. Could you please describe why this is not possible to achieve with less code copied from Django?

My Django Version : 2.1.5

Actually I'm not very proficient in django, This is just a temporary solution I researched yesterday, you can implement it in a better way .

This code is django source code , link is https://github.com/django/django/blob/80a5667c50d12b27a031a9ce0408a5b81bc4e684/django/contrib/admin/utils.py#L341

This is code call stack frame: https://github.com/PetrDlouhy/django-related-admin/issues/12#issuecomment-1669245857