There are some collections that I created using flask-mongoEngine. For example, such as Author, Book, Company. The same part is they have 2 filed named
created_at = db.DateTimeField(required=True, default=utcnow())
updated_at = db.DateTimeField(required=True, default=utcnow())
Everytime I create a new document, I need to update the value of created_at and updated_at , also when I update the document, I need to update the value of updated_at. Are there a good way, when I do save() operation, these time field can auto update?