from django.db import models
from apps.utils.models import BaseModel, CommonADModel, CommonBDModel
# Create your models here.


class Dataset(CommonBDModel):
    name = models.CharField('名称', max_length=100)
    code = models.CharField('标识', max_length=100, default='', blank=True)
    description = models.TextField('描述说明', default='', blank=True)
    sql_query = models.TextField('sql查询语句', default='', blank=True)
    echart_options = models.TextField(default='', blank=True)
    default_param = models.JSONField('默认查询参数', default=dict, blank=True)
    cache_seconds = models.PositiveIntegerField('缓存秒数', default=10, blank=True)


# class Report(CommonBDModel):
#     name = models.CharField('名称', max_length=100)
#     code = models.CharField('标识', max_length=100, default='', blank=True)
#     js_function = models.TextField('数据转化函数', default='', blank=True)
#     datasets = models.ManyToManyField(Dataset, verbose_name='关联数据集', blank=True)
