Aucune description

models.py 3.1KB

    # -*- coding: utf-8 -*- from django.db import models from django.utils.translation import ugettext_lazy as _ from django_models_ext import BaseModelMixin class RegisterStatisticInfo(BaseModelMixin): ymd = models.CharField(_(u'ymd'), max_length=8, blank=True, null=True, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') class Meta: verbose_name = _(u'注册用户统计') verbose_name_plural = _(u'注册用户统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'ymd': self.ymd, 'num': self.num, } class SaleStatisticInfo(BaseModelMixin): ymd = models.CharField(_(u'ymd'), max_length=8, blank=True, null=True, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') class Meta: verbose_name = _(u'销量统计') verbose_name_plural = _(u'销量统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'ymd': self.ymd, 'num': self.num, } class ModelSaleStatisticInfo(BaseModelMixin): model_id = models.CharField(_(u'model_id'), max_length=32, help_text=u'型号唯一标识', db_index=True) model_name = models.CharField(_(u'model_name'), max_length=255, blank=True, null=True, help_text=u'型号名称') ymd = models.CharField(_(u'ymd'), max_length=8, blank=True, null=True, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') class Meta: verbose_name = _(u'型号销量统计') verbose_name_plural = _(u'型号销量统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'model_id': self.model_id, 'model_name': self.model_name, 'ymd': self.ymd, 'num': self.num, } class DistributorSaleStatisticInfo(BaseModelMixin): distributor_id = models.CharField(_(u'distributor_id'), max_length=32, help_text=u'经销商唯一标识', db_index=True) distributor_name = models.CharField(_(u'distributor_name'), max_length=255, blank=True, null=True, help_text=u'经销商名称') ymd = models.CharField(_(u'ymd'), max_length=8, blank=True, null=True, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') class Meta: verbose_name = _(u'经销商销量统计') verbose_name_plural = _(u'经销商销量统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'distributor_id': self.distributor_id, 'distributor_name': self.distributor_name, 'ymd': self.ymd, 'num': self.num, }