Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

django column to have duplicate of other

class Person(models.Model):
    amount = models.CharField(max_length=50,blank=True, null=True)
    amount_paid = models.CharField(max_length=60,default='5000', null=True)

    def save(self, *args, **kwargs):
       self.amount_paid = self.amount
       super().save(*args, **kwargs)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #django #column #duplicate
ADD COMMENT
Topic
Name
2+1 =