Last active
August 25, 2020 06:10
-
-
Save velotiotech/a00f0095bd859b9c29ff38e3f27e7258 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# override the get_serializer_context method in the generic viewset | |
class UserCreateListAPIView(generice.ListCreateAPIView): | |
def get_serializer_context(self): | |
context = super().get_serializer_context() | |
# Update context data to add new data | |
context.update({"valid_domains": ValidDomain.objects.all()}) | |
return context |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment