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

Support assigning serializer instances to views #89

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

stevelacey
Copy link
Contributor

@stevelacey stevelacey commented Jan 7, 2022

Support assigning serializer instances to views as well as types.

This saves on needing to create types for simpler views that just need to limit the fields dumped:

class CandidateList(ListAPI):
    serializer = CandidateSerializer(
        only=[
            "freelancer.id",
            "freelancer.rating",
            "freelancer.user",
            "job.id",
            "job.company.id",
            "job.company.name",
            "job.title",
            "job.closes_at",
            "status",
        ]
    )

Checklist

  • This PR increases test coverage
  • This PR includes README updates reflecting any new features/improvements to the framework

@stevelacey stevelacey changed the title Support assigning serializer instances to view Support assigning serializer instances to views Jan 7, 2022
@stevelacey stevelacey force-pushed the feature/assign-serializer-instances branch 5 times, most recently from 5b38690 to d1334ba Compare January 7, 2022 07:21
@stevelacey stevelacey force-pushed the feature/assign-serializer-instances branch from d1334ba to 836b6b9 Compare January 10, 2022 13:45
@stevelacey stevelacey merged commit 93fd206 into master Jan 10, 2022
@stevelacey stevelacey deleted the feature/assign-serializer-instances branch January 10, 2022 14:21
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