Пример #1
0
 def get(self,idc,title):
   idcc=int(idc)
   modelDocOne=DocPost.all().filter('idc = ', idcc)
   modelDocOne.get()
   if modelDocOne.count()==0:
     self.redirect("/error/")
   u=users.get_current_user()
   listNeed=self.listNeedCM()
   pro=Profile.all()
   tagList=DocTag.all()
   link=ListYou.all()
   theme=ThemeTwo.all()
   listNeed=self.listNeedCM()
   template_values = {'modelDocOne': modelDocOne,'u': u,'listNeed': listNeed,'pro': pro,'tagList': tagList,'link': link,'listNeed': listNeed,'theme': theme,}
   self.htmlRenderCM('../template/one.html',template_values)
Пример #2
0
 def get(self,page=1):
   listNeed=self.listNeedCM()
   link=ListYou.all()
   #comment=DocPost.all()
   page=int(page)
   limit=5
   comment_query = DocPost.all().order('-date')
   count=comment_query.count()
   if (page-1)*limit>count:
     self.redirect("/error/")
   mm=self.navigationCM(page,count,limit)
   of=(mm['current']-1)*limit
   comment = comment_query.fetch(limit=limit, offset=of)
   template_values = {'listNeed': listNeed,'link': link,'comment': comment,'mm': mm,}
   self.htmlRenderCM('../template/list.html',template_values)
Пример #3
0
 def get(self,page=1):
   page=int(page)
   limit=4
   #modelDocPost_query = DocPost.all().order('-date')
   p=DocPostM()
   modelDocPost_query = p.get_docpost() 
   count=modelDocPost_query.count()
   if (page-1)*limit>count:
     self.redirect("/error/")
   mm=self.navigationCM(page,count,limit)
   of=(mm['current']-1)*limit
   modelDocPost = modelDocPost_query.fetch(limit=limit, offset=of)
   listNeed=self.listNeedCM()
   tagList=DocTag.all()
   link=ListYou.all()
   pro=Profile.all()
   theme=ThemeTwo.all()
   template_values = {'modelDocPost': modelDocPost,'listNeed': listNeed,'mm': mm,'tagList': tagList,'link': link,'pro': pro,'theme': theme,}
   self.htmlRenderCM('../template/doc.html',template_values)
Пример #4
0
 def get(self,tagc,page=1):
   page=int(page)
   tagText=urllib.unquote(tagc).decode("utf-8")
   limit=2
   m=DocPost.all().filter('tags =', tagText)
   if m.count()==0:
     self.redirect("/error/")
   count=m.count()
   if (page-1)*limit>count:
     self.redirect("/error/")
   mm=self.navigationCM(page,count,limit)
   of=(mm['current']-1)*limit
   modelDocTag=m.fetch(limit=limit, offset=of)
   pro=Profile.all()
   tagList=DocTag.all()
   link=ListYou.all()
   theme=ThemeTwo.all()
   listNeed=self.listNeedCM()
   template_values = {'modelDocTag': modelDocTag,'mm': mm,'pro': pro,'tagList': tagList,'link': link,'listNeed': listNeed,'theme': theme,}
   self.htmlRenderCM('../template/tag.html',template_values)