First Check
Commit to Help
Example Code
fromdatetimeimportdatetimefromtypingimportOptionalfromsqlmodelimportField, SQLModel, DateTimeclassImage_Save_Record(SQLModel, table=True):
id: Optional[int] =Field(default=None, primary_key=True)
camera_ip: strcamera_channel: intfile_path: strfile_name: strcreate_time: DateTimeupdate_time: DateTime
Description
when i create a Image_Save_Record instance and commit it to db, the create_time field value should be that system time current.
# django versioncreate_time=models.DateTimeField(auto_now_add=True)
when i change the Image_Save_Record instance which i created before and commit it to db, the update_time field value should be that system time current.
# django versionupdate_time=models.DateTimeField(auto_now=True)
Is there sqlmodel have option to do the same like this?
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.6
Python Version
3.7.9
Additional Context
No response
First Check
Commit to Help
Example Code
Description
when i create a Image_Save_Record instance and commit it to db, the create_time field value should be that system time current.
when i change the Image_Save_Record instance which i created before and commit it to db, the update_time field value should be that system time current.
Is there sqlmodel have option to do the same like this?
Operating System
Windows
Operating System Details
No response
SQLModel Version
0.0.6
Python Version
3.7.9
Additional Context
No response