Skip to content
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

Allow fields to be explicitly excluded from serialization/deserialization #193

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ababic
Copy link
Contributor

@ababic ababic commented Oct 27, 2024

Rationale

It's very common in Wagtail projects to have models with fields that fall into both categories of:

  1. Fields that are revised by editors
  2. Fields that are managed automatically by signals or some other background process, and are meaninful to the object as a whole.

Always including every field in the serialization/deserialization process adds unnecessary overhead in cases where a model's with_content_json() method will override the value anyway. There's practically zero value in having these values be included in revision content either, as they will always be ignored, and just adds to the overhead of loading/converting revision content from the database.

@ababic ababic marked this pull request as draft October 27, 2024 07:20
@ababic ababic force-pushed the feature/exclude-fields-from-revisions branch 3 times, most recently from 2a9995c to 2ac6910 Compare October 28, 2024 06:45
@ababic ababic force-pushed the feature/exclude-fields-from-revisions branch from 2ac6910 to 8f76013 Compare October 28, 2024 06:52
@ababic ababic force-pushed the feature/exclude-fields-from-revisions branch from 8f76013 to 2ee1427 Compare October 28, 2024 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant