07 2013 档案

java spring 使用注解来实现缓存
摘要:这里举例使用spring3.1.4 + ehcache注解的方式使用cache 是在spring3.1加入的使用方法:1.ehcache依赖+spring依赖 net.sf.ehcache ehcache 2.7.2 org.springframework spring-core 3.1.4.RELEASE org.springframework spring-web 3.1.4.RELEASE ... 阅读全文

posted @ 2013-07-12 10:57 DON'T PANIC 阅读(3054) 评论(1) 推荐(0)

Scrapy 对不同的Item进行分开存储
摘要:在Piperlines里面进行对象的判断,def process_item(self, item, spider): if item.__class__ == BaseItem : #savexxx else item.__class__ == BookItem: #savexxx222 return item 这里 对象判断也可写成isinstance(item,BaseItem) #继承的类也会是True ,而 __class__ 必须是一个类type(item)只有内置对象才能用. 阅读全文

posted @ 2013-07-09 12:38 DON'T PANIC 阅读(1094) 评论(0) 推荐(0)

导航