# -*- coding: utf-8 -*-

from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_models_ext import BaseModelMixin, upload_file_url, upload_path
from shortuuidfield import ShortUUIDField


class MchLogInfo(BaseModelMixin):
    log_id = ShortUUIDField(_(u'log_id'), max_length=32, help_text=u'日志唯一标识', db_index=True)
    log_file = models.FileField(_(u'log_file'), upload_to=upload_path, blank=True, null=True, help_text=u'日志文件')

    operator_id = models.CharField(_(u'operator_id'), max_length=32, blank=True, null=True, help_text=u'操作员唯一标识', db_index=True)

    app_version = models.IntegerField(_(u'app_version'), default=0, help_text=u'APP 版本号', db_index=True)

    class Meta:
        verbose_name = _(u'mchloginfo')
        verbose_name_plural = _(u'mchloginfo')

    def __unicode__(self):
        return unicode(self.pk)
