Answer the question
In order to leave comments, you need to log in
Why doesn't auto_now_add work on a Django model?
There are two models:
class Weather(models.Model):
putdate = models.DateTimeField(auto_now_add=True)
...
class WeatherCurrent(models.Model):
putdate = models.DateTimeField(auto_now_add=True)
...
Answer the question
In order to leave comments, you need to log in
auto_now_add is adding the current date when inserting a record into the table, with all subsequent updates of the record, this date will not change. If you want the field to be updated every time the record changes, you need to set the auto_now=True flag
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question