Example #1
0
 def post(self):
   modelListYou=ListYou()
   modelListYou.name = self.request.get("linkname")
   modelListYou.put()
   m=modelListYou.key().id()
   modelListYou.idc = m
   modelListYou.put()
   self.redirect(self.request.referer)
Example #2
0
 def get(self,idc):    
   g =int(idc)
   y=ListYou.get_by_id(g)
   yy=y.idc
   t=ListYouTwo.all().filter('lidc =', yy)
   db.delete(y)
   db.delete(t)
   self.redirect(self.request.referer)
Example #3
0
 def post(self):
   
   from cm.model.databaseModel import ListYou
   from cm.model.databaseModel import ListYouTwo
   c = self.request.get("commentIdc")
   cc=int(c)
   q=ListYou.get_by_id(cc)
   ListYou = ListYouTwo(contact=q)
   n=self.request.get("linkname")
   if n=="":
     n="ccdjh"
   l=self.request.get("link")
   if l=="":
     l="http://www.ccdjh.cn"
   else:
       from google.appengine.ext.db import BadValueError
       try:
           l = db.Link(l)
       except BadValueError:
           l="http://www.ccdjh.com"
           
   ListYou.comment = n
   ListYou.link = db.Link(l)
   ListYou.lidc=cc
   ListYou.put()
   m=ListYou.key().id()
   ListYou.idc = m
   ListYou.put()
   self.redirect(self.request.referer)
Example #4
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)
Example #5
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)
Example #6
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)
Example #7
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)