This commit is contained in:
sherlockforrest
2023-06-20 09:22:53 +08:00
commit bf2ed2e31f
621 changed files with 271599 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from django.db import models
class CarRecord(models.Model):
carno = models.CharField(max_length=7)
reason = models.CharField(max_length=50)
date = models.DateTimeField(db_column='happen_date', auto_now_add=True)
punish = models.CharField(max_length=50)
isdone = models.BooleanField(default=False)
@property
def happen_date(self):
return self.date.strftime('%Y-%m-%d %H:%M:%S')
"""
return '%d%02d%02d%02d:%02d:%02d' % \
(self.date.year, self.date.month, self.date.day,
self.date.hour, self.date.minute, self.date.second)
"""
class Meta:
db_table = 'tb_car_record'
ordering = ('-date', )