UnisKB/apps/common/mixins/app_model_mixin.py

19 lines
501 B
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# coding=utf-8
"""
@project: maxkb
@Author
@file app_model_mixin.py
@date2023/9/21 9:41
@desc:
"""
from django.db import models
from django.utils.translation import gettext_lazy as _
class AppModelMixin(models.Model):
create_time = models.DateTimeField(verbose_name=_('Create time'), auto_now_add=True)
update_time = models.DateTimeField(verbose_name=_('Update time'), auto_now=True)
class Meta:
abstract = True
ordering = ['create_time']