Files
sixGuoDjango/wechat_数据库/企业微信数据库/推广二维码数据表.py
T
2026-08-02 14:07:04 +08:00

30 lines
1.7 KiB
Python

from django.db import models
from uuid6 import uuid8
from wechat_数据库.用户数据库.小程序登陆用户 import models_app_name, weiuser
from wechat_数据库.雪花算法.雪花算法工具 import generator
class wecom推广码(models.Model):
"""城市信息表"""
objects = models.Manager() #
idKey = models.UUIDField(primary_key=True, default=uuid8)
id_str = models.CharField(max_length=128, default=generator.generate_str)
codeConfigId = models.CharField(max_length=128, )
codeType = models.IntegerField(blank=True, null=True, ) # 联系方式类型,1-单人, 2-多人
codeQrCode = models.CharField(max_length=256, blank=True, null=True, ) # 二维码图片链接
codeRemark = models.CharField(max_length=128, blank=True, null=True, ) # 备注的信息
codeState = models.CharField(max_length=128, blank=True, null=True, ) # 唯一的值(重要)
codeUser = models.JSONField(blank=True, null=True, ) # 使用该联系方式的用户userID列表,在type为1时为必填,且只能有一个
code省 = models.CharField(max_length=128, blank=True, null=True, )
code市 = models.CharField(max_length=128, blank=True, null=True, )
code区 = models.CharField(max_length=128, blank=True, null=True, )
wai外键weiuser表 = models.ForeignKey(to=weiuser, on_delete=models.CASCADE, )
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"]