Ejemplo n.º 1
0
    def get(self,search_term):
        pageStr = self.request.get('page')
        if pageStr:
            page = int(pageStr)
        else:
            page = 1;
        #search_term = self.request.get("q")
        #query = search.SearchableQuery('Weblog')
        #query.Search(search_term)
        #result = query.Run()
        query = db.Query(Weblog).filter('tags =', search_term).order('-date')
        try:
            cpedialog = util.getCPedialog()
            obj_page  =  Paginator(query,1000)
        except InvalidPage:
            self.redirect('/')
            return

        recentReactions = util.getRecentReactions()
        recentFeatured = util.getRecentFeatured()
        template_values = {
          'search_term':search_term,
          'page':obj_page,
          'recentReactions':recentReactions,
          'recentFeatured':recentFeatured,
          }
        self.generate('blog_main.html',template_values)
Ejemplo n.º 2
0
 def get(self, encoded_tag):
     tag =  urllib.unquote(encoded_tag)
     cpedialog = util.getCPedialog()
     posts = util.getDeliciousPost(cpedialog.delicious_username,tag)
     recentReactions = util.getRecentReactions()
     recentFeatured = util.getRecentFeatured()
     template_values = {
       'posts':posts,
       'tag':tag,
       'recentReactions':recentReactions,
       'recentFeatured':recentFeatured,
       }
     self.generate('tag_delicious.html',template_values)
Ejemplo n.º 3
0
 def get(self, encoded_tag):
     #tag =  re.sub('(%25|%)(\d\d)', lambda cmatch: chr(string.atoi(cmatch.group(2), 16)), encoded_tag)   # No urllib.unquote in AppEngine?
     #tag =  urllib.unquote(encoded_tag.encode('utf8'))
     tag = encoded_tag
     blogs = Weblog.all().filter('tags', tag).order('-date')
     recentReactions = util.getRecentReactions()
     recentFeatured = util.getRecentFeatured()
     template_values = {
       'blogs':blogs,
       'tag':tag,
       'recentReactions':recentReactions,
       'recentFeatured':recentFeatured,
       }
     self.generate('tag.html',template_values)
Ejemplo n.º 4
0
 def get(self,pagenum):
   page = int(pagenum)
   #get blog pagination from cache.
   obj_page = util.getBlogPagination(page)
   if obj_page is None:
       self.redirect('/')
       return
   recentReactions = util.getRecentReactions()
   recentFeatured = util.getRecentFeatured()
   template_values = {
     'page':obj_page,
     'recentReactions':recentReactions,
     'recentFeatured':recentFeatured,
     }
   self.generate('blog_main.html',template_values)
Ejemplo n.º 5
0
  def get(self):
    pageStr = self.request.get('page')
    if pageStr:
        page = int(pageStr)
    else:
        page = 1;

    #get blog pagination from cache.
    obj_page = util.getBlogPagination(page)

    recentReactions = util.getRecentReactions()
    recentFeatured = util.getRecentFeatured()
    template_values = {
      'page':obj_page,
      'recentReactions':recentReactions,
      'recentFeatured':recentFeatured,
      }
    self.generate('blog_main.html',template_values)