Django----抽屉项目 笔记
from django.db import models # Create your models here. class UserInfo(models.Model): username=models.CharField(max_length=32,db_index=True) email=models.CharField(max_length=32,unique=True) pwd=models.CharField(max_length=64) ctime=models.DateTimeField(auto_now_add=True) class Meta: index_together=[ ('username','pwd'), ] unique_together=[ ('username','email') ]
用and or 等操作 filter(Q(id__gt=1)|Q(name="root")) (邮箱&密码)|(用户名&密码) class Foo(forms.Form): email=... ret={'status'} success回调函数 合法 计时 不合法 显示错误
<select mulitiple> ..... 多选 </select> $.ajax({ url: data:$('ddd').seralize(), traditional:true, .... })