title: Django Rest Framework: Accessing validated_data outside of def create() method
body: <p>so I know my question is horribly written but I'm not sure the best way to phrase this. Let me explain.</p>
  <p>I'm trying to get my serializer class to process multiple value types for a specific field. For example, I need to Post the JSON values of items called &quot;Temp (C)&quot;, &quot;Humidity(%)&quot;, etc all under a specific field called &quot;value&quot; in my serializer class. I also of course have a model in models.py called &quot;value&quot;.</p>
  <p>This is what I have so far:</p>
  <p><strong>models.py</strong></p>
  <pre><code>class DataValueTable(models.Model):
      timestamp = models.FloatField()
      sensorName = models.TextField(null=True)
      value = models.FloatField()
  </code></pre>
  <p><strong>views.py</strong></p>
  <pre><code>class DataValueTableList(APIView):
  
      parser_classes = [JSONParser]
      authentication_classes = []
      permission_classes = []
  
      def post(self, request, format=None):
  
          serializer = DataValueTableSerializer(data=request.data)
          if serializer.is_valid():
              serializer.save()
              return Response(serializer.data, status=status.HTTP_201_CREATED)
          return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
  </code></pre>
  <p><strong>serializer.py</strong></p>
  <pre><code>class DataValueTableSerializer(serializers.ModelSerializer):
      class Meta: 
          model = DataValueTable
          fields = ['id', 'System Time', 'Node ID', 'Temp (C)', 'Humidity(%)', 'Pyra (WPM)',]
          extra_kwargs = {
              &quot;Node ID&quot;: {&quot;source&quot;: &quot;sensorName&quot;},
              &quot;System Time&quot;: {&quot;source&quot;: &quot;timestamp&quot;},
              &quot;Temp (C)&quot;: {&quot;source&quot;: &quot;value&quot;},
              &quot;Humidity(%)&quot;: {&quot;source&quot;: &quot;value&quot;},
              &quot;Pyra (WPM)&quot;: {&quot;source&quot;: &quot;value&quot;},
          }
  
      def create(self, validated_data):
          return DataValueTable.objects.create(**validated_data)
  </code></pre>
  <p><em>For the serializer.py:</em> The values im posting as JSON are different than the model names in models.py so I'm using &quot;extra_kwargs&quot; to map the JSON names to the models.</p>
  <p><em>Here's what I'm trying to Post:</em></p>
  <pre><code>{
      &quot;Node ID&quot;: &quot;2&quot;,
      &quot;Temp (C)&quot;: &quot;22.6&quot;,
      &quot;Humidity(%)&quot;: &quot;29.67&quot;,
      &quot;Pyra (WPM)&quot;: &quot;118.9&quot;,
      &quot;System Time&quot;: &quot;1592287220&quot;
  }
  </code></pre>
  <p><em>Here's the response:</em></p>
  <pre><code>{
      &quot;id&quot;: 126,
      &quot;System Time&quot;: 1592287220.0,
      &quot;Node ID&quot;: &quot;2&quot;,
      &quot;Temp (C)&quot;: 2.69,
      &quot;Humidity(%)&quot;: 2.69,
      &quot;Pyra (WPM)&quot;: 2.69,
  }
  </code></pre>
  <p>I was able to get all of those JSON items to Post, but the values are the same for each one which isn't good. I know what's wrong, the &quot;validated_data&quot; in the &quot;def create&quot; method only keeps track of the data up until the first instance of &quot;value&quot;, then it stops. In this case it goes through my &quot;fields&quot; list in my DataValueTableSerializer class and stops at &quot;Temp (C)&quot; because that's the first instance of &quot;value&quot;.</p>
  <p><strong>So here's my question:</strong> Is there a way to access this JSON data being Posted before it gets truncated in the &quot;def create&quot; method in the DataValueTableSerializer class? I'm hoping if I can access the data I could maybe manually map the values I need similar to how I did in &quot;extra_kwargs&quot;. Or if someone knows of an even better method than what I'm trying to do that would be amazing!</p>