Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Closes: #17936 - GFK serializer field #20706

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

Open
bctiemann wants to merge 5 commits into feature
base: feature
Choose a base branch
Loading
from 17936-gfk-serializer-field

Conversation

@bctiemann
Copy link
Contributor

@bctiemann bctiemann commented Oct 28, 2025

Closes: #17936

@bctiemann bctiemann marked this pull request as draft October 28, 2025 18:26
@bctiemann bctiemann marked this pull request as ready for review October 29, 2025 20:25
@bctiemann bctiemann requested review from a team and jeremystretch and removed request for a team October 29, 2025 20:25
Copy link
Member

@jeremystretch jeremystretch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found two serializers with generic foreign keys where GFKSerializerField is not being employed, presumably due to variations in the resolution logic.

  • ObjectChangeSerializer.changed_object: Suggest we replace the SerializerMethodField with GFKSerializerField, and expose object_repr as a regular read-only field. IMO this cleaner than the current fallback behavior.
  • EventRuleSerializer.action_object: I don't think the custom logic under get_action_object() is necessary anymore as there is a now a Script model: The automatic resolution should work.

Copy link
Contributor Author

Added those two; tested successfully, works nice. Added ObjectChangeSerializer.object_repr as a read-only CharField.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jeremystretch jeremystretch jeremystretch requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /