Skip to content

Add a way to handle annotations in the serializer #32

@MaxDude132

Description

@MaxDude132

Sometimes, you want to annotate a value to be used by the serializer. Currently, it has to be handled manually, and it does not play well with chained serializers. It would be nice to be able to do something like:

def add_annotations(self, context):
    return (
        {
            "field": "some_field_count",
            "annotation": Count("someField", distinct=True)
        },
    )

It should handle chaining properly and allow all types of annotations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions