title: Auto calculation on a field in a model in Django RESTframework
body: <p>So I have a model which has an attribute to be auto calculated when the api receives a POST request. The model is a bill model where the totalpayment is calculated on numberOfHours * paymentRate. Django does not allow me to do so by setting default value. Is there a way to do this?</p>
  
  <p>Model</p>
  
  <pre><code>class Bill(models.Model):
      billID = models.AutoField(primary_key=True)
      bill_dt = models.DateField()
      hours =  models.FloatField()
      workAssignmentID_fk = models.ForeignKey(WorkAssignment, null=True, default=None)
      totalPayment = models.FloatField(default=0)
  
      def __unicode__(self):
          return u'%s' % (self.bill_dt)
  
      def __str__(self):
          return u'%s' % (self.bill_dt)
  </code></pre>
  
  <p>Serializer</p>
  
  <pre><code>class ReadBillSerializer(serializers.HyperlinkedModelSerializer):
      workAssignmentID_fk = ReadWorkAssignmentSerializer()
  
      class Meta:
          model = Bill
          fields = ('url', 'bill_dt', 'hours', 'workAssignmentID_fk', 'totalPayment')
  
  class WriteBillSerializer(serializers.HyperlinkedModelSerializer):
      class Meta:
          model = Bill
          fields = ('url', 'bill_dt', 'hours', 'workAssignmentID_fk', 'totalPayment')
  </code></pre>
  
  <p>View</p>
  
  <pre><code>class BillViewSet(viewsets.ModelViewSet):
      queryset = Bill.objects.all()
  
      def get_serializer_class(self, *args, **kwargs):        
          if self.request.method == 'POST' or self.request.method == 'PUT':
              return WriteBillSerializer
          return ReadBillSerializer
  </code></pre>
  
  <p>In the model Bill, I want totalPayment = hours * workAssignmentID_fk.paymentRate.</p>
  
  <p>paymentRate is an attribute in the workAssignmentID_fk.</p>