I have a model with these 2 columns
- created_at: date
- last_updated_at: date
Is it possible to set these values automatically whenever a insert or update happens. Or should I be calling a method inside this class to do that.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Please read the Python-Executed Functions section of Column Insert/Update Defaults documentation.
Your code will then look similar to the following: