Can I have a field be writable for validation, but not get passed to the model save in django rest framework? -


currently i'm doing this:

class surveyresponseserializer(serializers.modelserializer):     repeat_email = serializers.charfield()      def create(self, validated_data):         validated_data.pop('repeat_email')         return super(surveyresponseserializer, self).create(validated_data) 

is there nicer way fix this? don't want keep growing create every field.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -