New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing #26524 - Change foreign key id list_display reference to display only the id #6497
Conversation
I wonder if the code could be abstracted better, for example, by adding a method to |
@timgraham would you want the abstraction to be completed before this PR is ready to land? |
I'm not too enthusiastic about the PR in its current form. I'm not sure if there's a more elegant way, but it looks a bit hacky to me. |
@timgraham , Apologies for the delay. I will spend some time this weekend and see if there is a better way to do this. |
@timgraham , Can you please take a look at this and let me know if this more acceptable? Any suggestions on making this better is welcome. |
@@ -9,3 +9,8 @@ class DisallowedModelAdminLookup(SuspiciousOperation): | |||
class DisallowedModelAdminToField(SuspiciousOperation): | |||
"""Invalid to_field was passed to admin view via URL query string""" | |||
pass | |||
|
|||
|
|||
class FieldIsAForeignKeyColumnName(Exception): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this is okay. Since the exception is just used as a sort of helper in one file, I'd put the exception there.
merged in f668139, thanks! |
I missed it, but for future reference use "Fixed" rather than "Fixing" in the commit message. |
Will keep that in mind. Thanks for merging. |
No description provided.