from django.db import models from uuid6 import uuid8 from wechat_数据库.用户数据库.小程序登陆用户 import models_app_name from wechat_数据库.雪花算法.雪花算法工具 import generator class wecom企微用户标签(models.Model): """城市信息表""" objects = models.Manager() # idKeywecom企微用户标签 = models.UUIDField(primary_key=True, default=uuid8) id_str = models.CharField(max_length=128, default=generator.generate_str) groupTag标签组ID = models.CharField(max_length=128, db_comment="标签组名") groupTag标签组名 = models.CharField(max_length=128, db_comment="标签组名") groupTag标签创建时间 = models.IntegerField() tag子标签ID = models.CharField(max_length=128, ) tag子标签名称 = models.CharField(max_length=128, ) tag子标签创建时间 = models.IntegerField() dateAndTime = models.DateTimeField(auto_now_add=True, db_comment="创建时间") # 数据创建时间 updateTime = models.DateTimeField(auto_now=True, db_comment="更新时间") # 更新时间(需要用 save() ) class Meta: db_table = "wecom企微用户标签" # 给数据表自定义一个名称;默认的会是在 应用名+类名 app_label = models_app_name ordering = ["-dateAndTime", "-updateTime"]