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

from django.db import models
from django.utils.translation import ugettext_lazy as _

from course.basemodels import CreateUpdateMixin


class CourseCodeInfo(CreateUpdateMixin):
    code = models.CharField(_(u'code'), max_length=255, blank=True, null=True, help_text=u'兑换码', db_index=True)
    exchanged = models.BooleanField(_(u'exchanged'), default=False, help_text=_(u'兑换状态'), db_index=True)

    user_id = models.CharField(_(u'user_id'), max_length=255, blank=True, null=True, help_text=u'用户唯一标识', db_index=True, unique=True)

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

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