码迷,mamicode.com
首页 > 其他好文 > 详细

测试功夫不负有心人

时间:2017-01-14 07:24:35      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:bst   exist   pre   lin   get   val   erb   blank   bsp   

功夫不负有心人

Python代码

from django.db import models
from django.contrib.auth.models import User
# Create your models here.
class Customer(models.Model):
    ‘‘‘客户信息表‘‘‘
    name = models.CharField(max_length=32,blank=True,null=True)
    qq = models.CharField(max_length=64,unique=True)
    qq_name = models.CharField(max_length=64,blank=True,null=True)
    phone = models.CharField(max_length=64,blank=True,null=True)
    source_choices = ((0,‘转介绍‘),
                      (1,‘QQ群‘),
                      (2,‘官网‘),
                      (3,‘百度推广‘),
                      (4,‘51CTO‘),
                      (5,‘知乎‘),
                      (6,‘市场推广‘)
                      )

    source = models.SmallIntegerField(verbose_name="报名渠道",choices=source_choices)
    referral_from = models.CharField(verbose_name="转介绍人qq",max_length=64,blank=True,null=True)

    consult_course = models.ForeignKey("Course",verbose_name="咨询课程")
    content = models.TextField(verbose_name="咨询详情")
    tags = models.ManyToManyField("Tag",blank=True,null=True)
    consultant = models.ForeignKey("UserProfile")
    memo = models.TextField(blank=True,null=True)
    date = models.DateTimeField(auto_now_add=True)
    status_choices = ((0,‘已报名‘),
                      (1,‘未报名‘),)
    status = models.SmallIntegerField(verbose_name="报名状态",choices=status_choices,default=1)
    def __str__(self):
        return self.qq

    class Meta:
        verbose_name = "客户表"
        verbose_name_plural = ‘客户信息表‘

js代码

 

测试功夫不负有心人

标签:bst   exist   pre   lin   get   val   erb   blank   bsp   

原文地址:http://www.cnblogs.com/hellojesson/p/6284471.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!