"> Issues 0 Pull Requests 0 Commits 767 Releases 0

No Description

models.py 12KB

    # -*- coding: utf-8 -*- from django.conf import settings from django.db import models from django.utils.translation import ugettext_lazy as _ from django_models_ext import BaseModelMixin from jsonfield import JSONField from utils.rdm_utils import randnum class RegisterStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) ymd = models.IntegerField(_(u'ymd'), default=0, 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } # 经销商维度 class SaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) ymd = models.IntegerField(_(u'ymd'), default=0, 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ModelSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) 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.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } # TODO: ROI Calc @property def roi(self): return { 'model_id': self.model_id, 'model_name': self.model_name, 'roi': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class DistributorSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) 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.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ProvinceSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) province_code = models.CharField(_(u'province_code'), max_length=6, help_text=u'省份编码', db_index=True) province_name = models.CharField(_(u'province_name'), max_length=8, blank=True, null=True, help_text=u'省份名称') ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') position = models.IntegerField(_(u'position'), default=1, help_text=u'排序') class Meta: verbose_name = _(u'[经销商维度]省份销量统计') verbose_name_plural = _(u'[经销商维度]省份销量统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'province_code': self.province_code, 'province_name': self.province_name, # 'ymd': self.ymd, 'num': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class SaleclerkSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) distributor_id = models.CharField(_(u'distributor_id'), max_length=32, blank=True, null=True, help_text=u'经销商唯一标识', db_index=True) distributor_name = models.CharField(_(u'distributor_name'), max_length=32, blank=True, null=True, help_text=u'经销商名称') distributor_short_name = models.CharField(_(u'distributor_short_name'), max_length=8, blank=True, null=True, help_text=u'经销商简称') clerk_id = models.CharField(_(u'clerk_id'), max_length=32, blank=True, null=True, help_text=u'店员唯一标识', db_index=True) clerk_name = models.CharField(_(u'clerk_name'), max_length=32, blank=True, null=True, help_text=u'店员名称') ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 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_name': self.distributor_short_name or self.distributor_name or '', 'salesman_id': self.clerk_id, 'salesman_name': self.clerk_name, # 'ymd': self.ymd, 'num': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } # 消费者维度 class ConsumeUserStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d') users = JSONField(_(u'users'), default=[], help_text=u'用户列表') 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ConsumeSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) ymd = models.IntegerField(_(u'ymd'), default=0, 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ConsumeModelSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) 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'型号名称', db_index=True) ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ConsumeDistributorSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) 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.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 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': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, } class ConsumeProvinceSaleStatisticInfo(BaseModelMixin): brand_id = models.CharField(_(u'brand_id'), max_length=32, blank=True, null=True, help_text=u'品牌唯一标识', db_index=True) province_code = models.CharField(_(u'province_code'), max_length=6, help_text=u'省份编码', db_index=True) province_name = models.CharField(_(u'province_name'), max_length=8, blank=True, null=True, help_text=u'省份名称') ymd = models.IntegerField(_(u'ymd'), default=0, help_text=u'年月日', db_index=True) # 例:20171208, tc.local_string(format='%Y%m%d'), 0 为全部 num = models.IntegerField(_(u'num'), default=0, help_text=u'数量') position = models.IntegerField(_(u'position'), default=1, help_text=u'排序') class Meta: verbose_name = _(u'[消费者维度]省份销量统计') verbose_name_plural = _(u'[消费者维度]省份销量统计') def __unicode__(self): return unicode(self.pk) @property def data(self): return { 'province_code': self.province_code, 'province_name': self.province_name, 'ymd': self.ymd, 'num': randnum() if settings.DEBUG_STATISTIC_DATA_FLAG else self.num, }
kodo - Gogs: Go Git Service

暫無描述

FFIB: aa2fd2f167 shot_create 防止重复录入 2 年之前
..
algorithm f38d3bf980 Caesar Alg 8 年之前
error aa2fd2f167 shot_create 防止重复录入 2 年之前
kuaidi fd8d621642 :art: KuaiDi100Subscribe for tenancy 4 年之前
redis fe6c35b7eb :art: Cache wxacode qiniu_url / scene 4 年之前
shells 95dc031155 :art: create_update_membercard 5 年之前
sql f3cf68f957 Add PAI2_HOME_WX_API for request.weixin 9 年之前
tencentcloud 3678649f11 :art: Add api tencentcloud/faceid/eidtoken 4 年之前
zbar 3e9628d0c9 iSort & Pycodestyle 6 年之前
__init__.py 52ce35cbfc add api uuid_init/uuid 11 年之前
admin_utils.py 5e79a1088e :art: iSort 5 年之前
disk_utils.py af2b3f483f change download.html to be generated from download.tmpl.html 10 年之前
group_photo_utils.py 0e7b5eb1af Update order_by of group session photos 9 年之前
message_utils.py f998fb9ef7 :art: iSort & PEP8 5 年之前
original_CGzC_10a50000c8811190.bak.jpg 290ff6960f pyzbar 7 年之前
original_CGzC_10a50000c8811190.jpg 680f424408 Update water mark 9 年之前
paiai_96_96.png 4a8b4f8819 add watermark 11 年之前
paiai_water_mark.png 680f424408 Update water mark 9 年之前
price_utils.py 24e345a32f Add price func get_group_photo_price 9 年之前
qiniucdn.py 6472cab908 :art: Support QINIU_FILE_URL_BEFORE / QINIU_FILE_URL_AFTER 4 年之前
rdm_utils.py 4efb7f6f87 Statistic 8 年之前
storage_qiniu_utils.py f998fb9ef7 :art: iSort & PEP8 5 年之前
storage_utils.py f998fb9ef7 :art: iSort & PEP8 5 年之前
thumbnail_utils.py 5c9e21b29b add Only Once Function statistic_thumbnail_size to statistic thumbnail size 10 年之前
time_utils.py 511533855d Change oauth to use http 9 年之前
url_utils.py 135c21b40c from models_ext import BaseModelMixin, upload_file_url, upload_path 8 年之前
version_utils.py 13816e8774 Fix Bug: REQUEST 8 年之前
watermark_utils.py 5411626ebe Change watermark position 9 年之前
wx_utils.py 32a7d9ffa0 Update wx relative 9 年之前