摘要: {{ request.user.mobile|default_if_none:'' }}字段为空时指定其值 阅读全文
posted @ 2017-07-05 23:02 lemonlemontree 阅读(427) 评论(0) 推荐(0) 编辑
摘要: model定义gender = models.CharField(max_length=2, choices=(('male', u'男'), ('female', u'nv')), verbose_name=u'性别')html取值object.get_gender_display 阅读全文
posted @ 2017-06-27 00:34 lemonlemontree 阅读(1291) 评论(0) 推荐(0) 编辑
摘要: 切片: 通过指定下标的方式来获得某一个数据元素,或者通过指定下标范围来获得一组序列的元素,这种访问序列的方式叫做切片。 访问某一个数据元素的的语法如下: sequence[index] sequence是序列名,index是想要访问的元素对应的偏移量,偏移量可以是正值,范围是:0<=index<=l 阅读全文
posted @ 2017-06-12 23:17 lemonlemontree 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 1、编辑(Editing) Ctrl + Space 基本的代码完成(类、方法、属性)Ctrl + Alt + Space 快速导入任意类Ctrl + Shift + Enter 语句完成Ctrl + P 参数信息(在方法中调用参数)Ctrl + Q 快速查看文档Shift + F1 外部文档Ctr 阅读全文
posted @ 2017-06-12 21:19 lemonlemontree 阅读(158) 评论(0) 推荐(0) 编辑
摘要: <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid 阅读全文
posted @ 2017-06-01 23:20 lemonlemontree 阅读(145) 评论(0) 推荐(0) 编辑
摘要: <div class="container-fluid"> <div class="row-fluid"> <div class="span12"> <div class="row-fluid"> <div class="span6"> </div> <div class="span6"> </di 阅读全文
posted @ 2017-06-01 22:59 lemonlemontree 阅读(245) 评论(0) 推荐(0) 编辑
摘要: git init # 初始化本地git仓库(创建新仓库) git config --global user.name "xxx" # 配置用户名 git config --global user.email "xxx@xxx.com" # 配置邮件 git config --global color 阅读全文
posted @ 2017-05-30 22:51 lemonlemontree 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 在Windows7x64下使用pip安装包的时候提示报错:Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat) 环境:windows10 x64 ,python2.7 ,VS2015 原因:windows下使用pip安 阅读全文
posted @ 2017-05-30 20:22 lemonlemontree 阅读(9077) 评论(0) 推荐(0) 编辑