iT邦幫忙

0

Day18 參加職訓(機器學習與資料分析工程師培訓班),Django

今日一樣教學Django

class registration_info(models.Model):
    dept_select = (
        ('IT', '資訊課'),
        ('HR', '人資課'),
        ('RD', '研發課'),
        ('PR', '公關課')
    )
    uid = models.CharField(max_length=20, unique=True, verbose_name='用户名')
    pwd = models.CharField(max_length=128)
    email= models.EmailField()
    signup_time = models.DateTimeField(auto_now_add=True)
    last_login = models.DateTimeField(auto_now=True)
    id_no = models.CharField(max_length=10)
    cellphone = models.CharField(max_length=10)
    address = models.TextField()
    webpage = models.URLField()
    dept = models.CharField(max_length=2, default="IT" , choices = dept_select)
    st = models.BooleanField()
 
    def __str__(self):
        return self.uid 

https://ithelp.ithome.com.tw/upload/images/20210723/20139039nWpPJtXk32.png
今日教學內容滿多的,放上來篇幅會很多,因此只放一部份上來。


尚未有邦友留言

立即登入留言