[book] update rql documentation and some erroneous/deprecated examples
# copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved.# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr## This file is part of CubicWeb.## CubicWeb is free software: you can redistribute it and/or modify it under the# terms of the GNU Lesser General Public License as published by the Free# Software Foundation, either version 2.1 of the License, or (at your option)# any later version.## CubicWeb is distributed in the hope that it will be useful, but WITHOUT# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more# details.## You should have received a copy of the GNU Lesser General Public License along# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.""""""fromcubicweb.goa.testlibimport*fromcubicweb.interfacesimportICalendarableclassBlog(db.Model):diem=db.DateProperty(required=True,auto_now_add=True)title=db.StringProperty(required=True)content=db.TextProperty()__implements__=(ICalendarable,)@propertydefstart(self):returnself.diem@propertydefstop(self):returnself.diemdefmatching_dates(self,begin,end):"""calendar views interface"""mydate=self.diemifmydate:return[mydate]return[]classSomeViewsTC(GAEBasedTC):MODEL_CLASSES=(Blog,)fromcubicweb.web.viewsimportbasecontrollers,baseviews,navigation,boxes,calendarfromdataimportviewsLOAD_APP_MODULES=(basecontrollers,baseviews,navigation,boxes,calendar,views)defsetUp(self):GAEBasedTC.setUp(self)self.req=self.request()self.blog=Blog(title=u'a blog',content=u'hop')self.blog.put(self.req)deftest_hcal(self):self.vreg['views'].render('hcal',self.req,rset=self.blog.rset)deftest_django_index(self):self.vreg['views'].render('index',self.req,rset=None)forvidin('primary','oneline','incontext','outofcontext','text'):setattr(SomeViewsTC,'test_%s'%vid,lambdaself,vid=vid:self.blog.view(vid))if__name__=='__main__':fromlogilab.common.testlibimportunittest_mainunittest_main()