摘要: create or replace function addjifen( iuserid text, iamout INTEGER)returns textAS\[BEGIN return 'hello word';END\] LANGUAGE plpgsql;select addjifen('10020202', 1) 阅读全文
posted @ 2015-12-04 14:10 springday 阅读(268) 评论(0) 推荐(0) 编辑
摘要: sudo lsof -i :5433ps xuwww -p 91sudo port install py27-psycopg2 阅读全文
posted @ 2015-11-29 23:03 springday 阅读(179) 评论(0) 推荐(0) 编辑
摘要: (1) download mysql dmg(2) install(3) /usr/local/mysql/bin/mysql -u root -p change password 阅读全文
posted @ 2015-11-29 22:26 springday 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 项目中经常会遇到用户权限管理的问题,django adminsite已经提供非常实用的用户权限管理机制。不过有些时候,我们希望根据相关用户属性来过滤adminsite中显示的内容。下文将结束如何实现:原始类假设我有这么一个问卷类,基于这个类可以实现增删改查的功能class wenjuan(models.Model): """ 问卷 """ name=models.CharF... 阅读全文
posted @ 2015-11-05 17:32 springday 阅读(435) 评论(0) 推荐(0) 编辑
摘要: 网站开发离不开数据的导入导出,本文将介绍一下django如何操作excel先安装 django-excelpip install django-excel配置一下urlurl(r'^download/tongji/(?P\d+)$', 'downloadtj', name='downloadtj'),返回excel文件import pyexcel_xlsxdef downloadtj(reques... 阅读全文
posted @ 2015-11-03 15:49 springday 阅读(631) 评论(0) 推荐(0) 编辑
摘要: pq函数功能很强大,我打算把统计的功能都放在数据库端。优势让运算离数据更近一些,缺点无法服用代码。牺牲了django的灵魂性,项目必须依赖postgresql。项目中,希望实现返回select内容后来通过bing.com查询,其实我需要的是返回表格。也是pq中的table,下面是demoCREATE OR REPLACE FUNCTION word_frequency(_max_tokens in... 阅读全文
posted @ 2015-10-28 23:02 springday 阅读(1104) 评论(0) 推荐(0) 编辑
摘要: 安装Apacheyum install httpd -ychkconfig httpd onservice httpd start配置一下iptablesiptables -I INPUT -p tcp --dport 80 -j ACCEPTservice iptables save2.安装vsftpdyum install -y vsftpd配置一下iptables一般ftp用20与联21... 阅读全文
posted @ 2015-10-28 21:08 springday 阅读(169) 评论(0) 推荐(0) 编辑
摘要: CREATE LANGUAGE plpgsql CREATE or REPLACE function getDatirenshu(w_wjID int)RETURNS INTEGERas 'DECLARE datiRenshu INTEGER;BEGIN select count(id) into datiRenshu from rfwenjuan_yuanshij... 阅读全文
posted @ 2015-10-27 17:26 springday 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 引自 PostgreSQL Server Programming-Second Editionpage81: 大部分时候,我们不需要快速的代码,而是能用的程序。 remember that most of the time,you don't need the absolutely fastest code. For your clients or bosses,the best co... 阅读全文
posted @ 2015-10-27 07:47 springday 阅读(145) 评论(0) 推荐(0) 编辑
摘要: from django.template import Context,TemplatetextTemplate=""" {{time}} {{MsgId}} {{AgentID}} """ def response_text(self,msg): ... 阅读全文
posted @ 2015-10-26 20:03 springday 阅读(436) 评论(0) 推荐(0) 编辑