You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.7 KiB
71 lines
2.7 KiB
|
2 days ago
|
from django.db import models
|
||
|
|
|
||
|
|
|
||
|
|
# Create your models here.
|
||
|
|
|
||
|
|
class Group(models.Model):
|
||
|
|
id = models.AutoField(primary_key=True, auto_created=True)
|
||
|
|
group_code = models.CharField(verbose_name='集团编码', max_length=20, null=False, unique=True)
|
||
|
|
group_name = models.CharField(verbose_name='集团编码', max_length=150, null=False, unique=True)
|
||
|
|
group_address = models.CharField(verbose_name='集团地址', max_length=150, null=False, unique=True)
|
||
|
|
cinema_count = models.IntegerField(verbose_name='影院数量')
|
||
|
|
is_delete = models.BooleanField(verbose_name="删除标记", default=False)
|
||
|
|
|
||
|
|
def __str__(self):
|
||
|
|
return self.group_code
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
verbose_name = '集团信息表'
|
||
|
|
verbose_name_plural = '集团信息表'
|
||
|
|
db_table_comment = '集团信息表'
|
||
|
|
db_table = 'group_info'
|
||
|
|
|
||
|
|
|
||
|
|
class GroupFuncs(models.Model):
|
||
|
|
id = models.AutoField(primary_key=True, auto_created=True)
|
||
|
|
func_model = models.CharField(verbose_name='模块', max_length=150, null=False)
|
||
|
|
func_name = models.CharField(verbose_name='功能名称', max_length=150, null=False)
|
||
|
|
exec_sql = models.TextField(verbose_name='查询sql', null=False)
|
||
|
|
is_delete = models.BooleanField(verbose_name="删除标记", default=False)
|
||
|
|
|
||
|
|
def __str__(self):
|
||
|
|
return self.func_name
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
verbose_name = '集团功能表'
|
||
|
|
verbose_name_plural = '集团功能表'
|
||
|
|
db_table_comment = '集团功能表'
|
||
|
|
db_table = 'group_func'
|
||
|
|
|
||
|
|
|
||
|
|
class GroupData(models.Model):
|
||
|
|
id = models.AutoField(primary_key=True, auto_created=True)
|
||
|
|
group = models.ForeignKey("Group", on_delete=models.CASCADE, null=False)
|
||
|
|
func = models.ForeignKey("GroupFuncs", on_delete=models.CASCADE, null=False)
|
||
|
|
data_count = models.IntegerField(verbose_name='数据量', null=False)
|
||
|
|
data_lasttime = models.DateTimeField(verbose_name='数据最后更新时间', null=False)
|
||
|
|
update_time = models.DateTimeField(verbose_name="数据更新时间", auto_now=True, null=False)
|
||
|
|
|
||
|
|
def __str__(self):
|
||
|
|
return self.id
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
verbose_name = '集团功能数据统计表'
|
||
|
|
verbose_name_plural = '集团功能数据统计表'
|
||
|
|
db_table_comment = '集团功能数据统计表'
|
||
|
|
db_table = 'group_data'
|
||
|
|
|
||
|
|
|
||
|
|
class GroupRuntime(models.Model):
|
||
|
|
runtime_key = models.CharField(verbose_name='运行时key', max_length=150, null=False)
|
||
|
|
runtime_value = models.TextField(verbose_name='运行时value', null=False)
|
||
|
|
|
||
|
|
def __str__(self):
|
||
|
|
return self.runtime_key
|
||
|
|
|
||
|
|
class Meta:
|
||
|
|
verbose_name = '集团数据运行时表'
|
||
|
|
verbose_name_plural = '集团数据运行时表'
|
||
|
|
db_table_comment = '集团数据运行时表'
|
||
|
|
db_table = 'group_runtime'
|