# coding=utf-8

from django.db import models
from django.utils import timezone
from django.conf import settings


class Wechat(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, editable=False, related_name='vehicle_ref_user_id', on_delete=models.PROTECT, verbose_name=u'用户')
    tel = models.CharField(verbose_name=u'电话', max_length=50)
    name = models.CharField(verbose_name=u'姓名', max_length=100)
    number = models.CharField(verbose_name=u'车牌号', max_length=30)
    model = models.CharField(verbose_name=u'车型', max_length=250)
    create_time = models.DateTimeField(verbose_name=u"创建时间", default=timezone.now, editable=False)

    class Meta:
        db_table = "vehicle"
        ordering = ['-id']
        index_together = (
            'tel',
            'number',
        )
        verbose_name = u"设备信息"
        default_permissions = ()
