def render_bloglist(self): blogs = FrontPage() points = filter(None, (b.coords for b in blogs)) #find which arts have coords #if we have any arts coords, make an image url; display img_url = None if points: img_url = utils.gmaps_img(points) querytime = getLastQueryTime() self.render("bloglist.html", blogs = blogs, img_url=img_url, querytime= querytime)
def render_ascii(self, title="", art="", error=""): arts = top_arts() # if we have arts coords, make an image url img_url = None points = filter(None, (a.author_loc for a in arts)) if points: img_url = gmaps_img(points) self.render('asciichan.html', title=title, art=art, error=error, arts=arts, img_url=img_url)
def render_front(self, title="", art="", error=""): arts = db.GqlQuery("Select * from Art Order By created DESC Limit 10") arts = list(arts) points = filter(None, (a.coords for a in arts)) #find which arts have coords #if we have any arts coords, make an image url; display img_url = None if points: img_url = utils.gmaps_img(points) self.render("front.html", title=title, art=art, error=error, arts=arts, img_url=img_url)
def render_ASCII_page(self, title="", art = "", error = ""): valid_cookie = self.request.cookies.get('user_id') if valid_cookie: import globals if globals.users != None: arts = utils.top_arts() img_url = None points = filter(None, (a.coords for a in arts)) if points: img_url = utils.gmaps_img(points) self.render("ASCIIChan.html", title = title, art = art, error = error, arts = arts, img_url = img_url, user = globals.users) else: self.redirect('/')
def render_front(self, title="", art="", error=""): arts = db.GqlQuery("SELECT * " "FROM Art " "WHERE ANCESTOR IS :1 " "ORDER BY created DESC " "LIMIT 10", art_key) #prevent the running of multiple queries arts = list(arts) #find which arts have coords img_url = None points = filter(None, (a.coords for a in arts)) if points: img_url = gmaps_img(points) #display the image URL self.render("ascii.html", title = title, art = art, error = error, arts = arts, img_url = img_url)