No Description

models.py 1.3KB

12345678910111213141516171819202122232425
  1. # -*- coding: utf-8 -*-
  2. from django.db import models
  3. from django.utils.translation import ugettext_lazy as _
  4. from django_models_ext import BaseModelMixin
  5. class MarketCodeInfo(BaseModelMixin):
  6. isv_application_id = models.CharField(_(u'isv_application_id'), max_length=128, blank=True, null=True, help_text=u'外部单号', db_index=True)
  7. application_id = models.IntegerField(_(u'application_id'), default=0, help_text=u'申请单号', db_index=True)
  8. lattice = models.CharField(_(u'code'), max_length=361, blank=True, null=True, help_text=u'361 字节的 01 点阵,用于支持生成 19 * 19 的微型码,0 为白,1 为黑')
  9. code = models.CharField(_(u'code'), max_length=16, blank=True, null=True, help_text=u'九位的字符串原始码', db_index=True)
  10. code_index = models.IntegerField(_(u'code_index'), default=0, help_text=u'该码在批次中的偏移量')
  11. code_url = models.CharField(_(u'code_url'), max_length=128, blank=True, null=True, help_text=u'28位普通码字符', db_index=True)
  12. has_used = models.BooleanField(_(u'has_used'), default=False, help_text=u'是否已使用')
  13. class Meta:
  14. verbose_name = _(u'一物一码信息')
  15. verbose_name_plural = _(u'一物一码信息')
  16. def __unicode__(self):
  17. return '%d' % self.pk