霍克依毒间

导航

 
上一页 1 ··· 4 5 6 7 8 9 10 下一页

2012年7月15日

摘要: 最近在python的邮件列表上看到有人问django如何实现多级联动菜单,我自己在做的一个项目也需要这个功能,但是找了半天也没有现成的解决方案,只好自己实现了一个。由于我对JavaScript不是很熟,所以采用了现成的Ajax框架,粗略比较了一下,选择了比较 Pythonic 的 MochiKit。Django没有绑定特定的Ajax框架有好有坏,好的方面,我们可以选择自己熟悉和喜欢的框架,坏的的方面,要和后台应用集成部分的工作就得全部自己来做了。废话不多说了,直接贴代码和说下基本原理。由于大部分代码直接抽取自我现在在做的项目,所以可扩展性还没有到达很好的程度,但是如果理解的话还是可以很容易适应 阅读全文
posted @ 2012-07-15 10:42 霍克依毒间 阅读(1037) 评论(0) 推荐(0) 编辑
 
摘要: jquery如何判断元素存在jquery选择器获取element 无论element是否存在都将返回一个对象Java代码varmy_element=$("#myId");这里无论元素"myid"是否存在,my_element始终是一个object使用下面的方法判断"myid"元素是否存在Java代码if(my_element.length>0)){alert("exist");}else{alert("notfound");}2.其它Java代码$("#myId").h 阅读全文
posted @ 2012-07-15 00:45 霍克依毒间 阅读(205) 评论(0) 推荐(0) 编辑
 

2012年7月13日

摘要: wuhuiming<blvming在gmail.com>,转载请注明来源和作者 最后修改:2010年1月23日1、简介1.1.Sphinx是什么1.2.Sphinx的特性1.3.Sphinx中文分词2、安装配置实例2.1 在GNU/Linux/unix系统上安装2.1.1 sphinx安装2.1.2.sfc安装(见另文)2.1.3.coreseek安装(见另文)2.2 在windows下安装3、 配置实例4、应用4.1 在CLI上测试4.2 使用API调用5、附录1.Sphinx简介1.1.Sphinx是什么Sphinx是由俄罗斯人Andrew Aksyonoff开发的一个全文检索 阅读全文
posted @ 2012-07-13 23:27 霍克依毒间 阅读(295) 评论(0) 推荐(0) 编辑
 

2012年7月10日

摘要: 今天因为需要要用的两个字典相加。即:a={'a':1}b={'b':2}需要c=a+b可是python的字典不支持直接相加。最后查了一下资料将问题解决了,方法是用字典的update方法。c={}c.update{a} #已经加a加入到了c中c.update{b} #将b也加入了c中 阅读全文
posted @ 2012-07-10 15:03 霍克依毒间 阅读(714) 评论(0) 推荐(0) 编辑
 

2012年6月26日

摘要: [编辑]指定认证后端在暗中,Django维护一个”authentication backends”的列表用来测试认证。当某人调用 django.contrib.auth.authenticate() — 上面提到的”如何登录一个用户” — Django将尝试所有的认证后端。如果第一个认证方法失败了,Django将会继续尝试第二个,直到所有的都被尝试过。认证后端的列表在 AUTHENTICATION_BACKENDS 设置。内容应该是包含Python路径的元组。默认情况下, AUTHENTICATION_BACKENDS 设置为(‘django.contrib.auth.backends.Mod 阅读全文
posted @ 2012-06-26 17:33 霍克依毒间 阅读(4128) 评论(0) 推荐(1) 编辑
 

2012年6月25日

摘要: django中得signals和操作系统(linux)中的signal完全是两会事,后者的signal是软件中断,提供一种处理异步事件得方法,信号是系统定义好的,可用作进程间传递消息得一种方法,而django中的信号只是一个普通的类,不能跨进程,看其代码更像一个。。。callback。。。django signal类定义在django/dispatch/dispatch.py中[python]view plaincopyprint?classSignal(object):def__init__(self,providing_args=None):#providing_args定义receive 阅读全文
posted @ 2012-06-25 15:59 霍克依毒间 阅读(570) 评论(0) 推荐(0) 编辑
 
摘要: The Django authentication system provided in django.contrib.auth requires the end user to authenticate themselves using a username and password. However, it is often desireable to allow users to log in using an email address rather than a username. There are a few different ways to accomplish this a 阅读全文
posted @ 2012-06-25 11:13 霍克依毒间 阅读(770) 评论(0) 推荐(0) 编辑
 

2012年6月24日

摘要: 执行命令D:\sphinx\bin>searchd --install --config d:/sphinx/bin/sphinx.conf --servicenameSphinxSearchD:\sphinx\bin>net start SphinxSearchSphinxSearch 服务正在启动 .SphinxSearch 服务无法启动。系统出错。发生系统错误 1067。进程意外终止。错误原因在于sphinx.conf中将utf-8错写为utf-8,修改后,成功。 阅读全文
posted @ 2012-06-24 22:48 霍克依毒间 阅读(829) 评论(0) 推荐(0) 编辑
 
摘要: Again, I still suck at documentation, and my “tutorials” aren’t in-depth enough. So hopefully this covers all of the questions regarding using the django-sphinx module.The first thing you’re going to need to do is install the Sphinx search software. You will be able to get this throughhttp://www.sph 阅读全文
posted @ 2012-06-24 21:56 霍克依毒间 阅读(306) 评论(0) 推荐(0) 编辑
 
摘要: 参考文章链接:http://github.com/dcramer/django-sphinxhttp://pkarl.com/articles/guide-django-full-text-search-sphinx-and-django-sp/http://www.davidcramer.net/code/79/in-depth-django-sphinx-tutorial.html首先需要已经安装好django以及sphinx我的版本如下:Django 1.1.1Sphinx 0.9.91.安装django-sphinx到http://pypi.python.org/pypi/django 阅读全文
posted @ 2012-06-24 21:45 霍克依毒间 阅读(1138) 评论(0) 推荐(0) 编辑
 
上一页 1 ··· 4 5 6 7 8 9 10 下一页