12 2016 档案

Django模型层Meta内部类详解
摘要:Django 模型类的Meta是一个内部类,它用于定义一些Django模型类的行为特性。以下对此作一总结: abstract 这个属性是定义当前的模型类是不是一个抽象类。所谓抽象类是不会对应数据库表的。一般我们用它来归纳一些公共属性字段,然后继承它的子类可以继承这些字段。比如下面的代码中Human是 阅读全文

posted @ 2016-12-23 16:03 星河赵 阅读(350) 评论(0) 推荐(0) 编辑

jquery checkbox的相关操作——全选、反选、获得所有选中的checkbox
摘要:1、全选 $("#btn1").click(function(){ $("input[name='checkbox']").attr("checked","true"); }) 2、取消全选(全不选) $("#btn2").click(function(){ $("input[name='check 阅读全文

posted @ 2016-12-19 10:14 星河赵 阅读(628) 评论(0) 推荐(0) 编辑

Linux 命令行模式 你需要知道的那些事
摘要:注: 安装软件 pip install + 软件名 例如: pip install xadmin 卸载软件 pip uninstall + 软件名 例如 pip uninstall xadmin 安装软件 sudo apt-get install .....(点点为程序名称) 卸载软件 sudo a 阅读全文

posted @ 2016-12-14 20:22 星河赵 阅读(3834) 评论(0) 推荐(0) 编辑

解决 Django 后台上传图片前端无法展示
摘要: 阅读全文

posted @ 2016-12-14 15:01 星河赵 阅读(580) 评论(0) 推荐(0) 编辑

Form onsubmit 事件 阻止表单提交() 必须选中同意选项才可以提交
摘要:<!DOCTYPE html><html><head><meta charset="utf-8"><title>菜鸟教程(runoob.com)</title><script>function greeting(){ alert("Welcome " + document.forms["frm1"] 阅读全文

posted @ 2016-12-12 16:28 星河赵 阅读(906) 评论(0) 推荐(0) 编辑

Django中Form的Textarea字段
摘要:开始以为是这个样子: [python] view plain copy class BlogForm(forms.Form): title = forms.CharField(required = True) content = forms.Textarea() [python] view plai 阅读全文

posted @ 2016-12-11 20:05 星河赵 阅读(6105) 评论(0) 推荐(1) 编辑

css实现自适应屏幕高度;
摘要:css实现自适应屏幕高度; <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title> <style> body,html{ margin:0px; height:100%; } .div1 阅读全文

posted @ 2016-12-09 13:25 星河赵 阅读(14113) 评论(1) 推荐(0) 编辑

Django 1.10 找不到静态资源解决方法
摘要:测试版本:Django 1.10 问题:Django项目找不到静态资源 解决方法: 1.首先你需要在自己的app下面创建2个目录 static 和 templates 树形结构如下(DjangoProject 是我的项目名 blogs 是app名,要创建的目录在blogs下) 1 2 3 4 5 6 阅读全文

posted @ 2016-12-08 11:59 星河赵 阅读(527) 评论(0) 推荐(0) 编辑

时间戳 JavaScript parse() 方法 处理技巧
摘要:返回1970/01/01至2012/3/21之间的毫秒数: var d = Date.parse("March 21, 2012"); d 输出结果: 1332259200000 实例 在本例中,我们将取得从 1970/01/01 到 2012/03/21 的毫秒数: var d=Date.pars 阅读全文

posted @ 2016-12-05 12:34 星河赵 阅读(487) 评论(0) 推荐(0) 编辑

jQuery radio change事件 checkbox选中事件
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.or 阅读全文

posted @ 2016-12-05 10:45 星河赵 阅读(859) 评论(0) 推荐(0) 编辑

JQuery中$.ajax()方法参数详解
摘要:JQuery中$.ajax()方法参数详解 JQuery中$.ajax()方法参数详解 url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址。 type: 要求为String类型的参数,请求方式(post或get)默认为get。注意其他http请求方法,例如put和 delet 阅读全文

posted @ 2016-12-05 09:56 星河赵 阅读(438) 评论(0) 推荐(0) 编辑

JS(去掉前后空格或去掉所有空格)的用法 推荐使用jquery 方法
摘要:说明: 如果使用jQuery直接使用$.trim(str)方法即可,str表示要去掉前后所有空格的字符串。 推荐 1、 去掉字符串前后所有空格: 代码如下: function Trim(str) { return str.replace(/(^\s*)|(\s*$)/g, ""); } 2、 去掉字 阅读全文

posted @ 2016-12-02 13:58 星河赵 阅读(39829) 评论(0) 推荐(1) 编辑

Jquery 中的$(this) 和javascript中的this
摘要:this 是 JavaScript 中的关键字。 $(this) 可以认为是用 jQuery 包装过 JavaScript 中的 this,包装后 $(this) 就会继承 jQuery 的方法。 阅读全文

posted @ 2016-12-02 09:30 星河赵 阅读(1899) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示