I have a table for CUSTOMER and a table for CUSTOMER_PAYMENT (w/ attributes customer, amount, date due and paid) . I want when I insert a value in CUSTOMER, values in CUSTOMER_PAYMENT will be automatically generated. It’s like a monthly billing information
Upon inserting customer A in CUSTOMER
CUSTOMER_PAYMENT
____________________________________
|CUSTOMER|AMOUNT| DUE | PAID |
| A | 100 | 2011-01-15| False |
| A | 100 | 2011-02-15| False |
| A | 100 | 2011-03-15| False |
How is that done?
There is no trigger in Django. I tried to Google but I can’t find how.
There are two ways:
Signals:
Overwriting: