- 博客(5)
- 收藏
- 关注
原创 django的model、form.py、内置widgets、html表单相关
一般来说我们可以使用modelForm来使其生成对应的表单,如:class ArticleForm(ModelForm): ... class Meta: ... model = Article ... fields = ['pub_date', 'headline', 'content', 'reporter'] 或者 class ArticleForm(M
2015-09-09 10:39:57 294
原创 django model field类型
默认:required = True,unique = True, primary_key = False(自增id除外), editable = True, default= xxx AutoField:Int自增类型,一般为主键id自增,一般不使用这种字段类型BigIntegerField:64位的int类型,对应form的widget:TextInputBinaryField:二进制类型Boo
2015-09-09 10:19:06 186
原创 Objective-C学习笔记
- (void):实例方法:对类的实例执行的操作[className InstanceMethod]要调用这个方法,首先得定义类的实例 Fraction *a [a InstanceMethod]+ (void):类方法:创建,操作对象(如计算对象的count之类的)[className classMethod],对整个类进行的操作,如alloc就是类方法或者使用static声明不需要实例化[
2015-09-08 09:20:02 160
转载 django的request对象
从URL中GET到关键字 <a href="blog/?id=3>博客标题</a>这样views里面的函数这么写获取到id的值def function(request): id = request.GET['id']不管是get请求,还是post请求,都可以用request.REQUEST.get('username','xxx') 假设访问的地址为http://your-site/?use
2015-09-07 16:15:39 221
转载 Debian 配置文件
1. 网络配置vi /etc/network/interfacesDHCP自动获取 auto eth0 (开机自动激活eth0接口) iface eth0 inet dhcp(配置eth0接口为) 网卡静态分配IP地址iface eth0 inet static address 10.16.3.99 netmask 255.255.255.0 network 10.16.3.0 broadcast
2015-09-07 15:24:07 212
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人