コード例 #1
0
ファイル: blog.py プロジェクト: tvec/blog-wiki-cs253
	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)
コード例 #2
0
ファイル: helloworld.py プロジェクト: Robdab/appengine
    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)
コード例 #3
0
ファイル: asciichan.py プロジェクト: tvec/blog-wiki-cs253
	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)
コード例 #4
0
ファイル: aschii.py プロジェクト: sub14305k/bs_hw
    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('/')
コード例 #5
0
ファイル: ascii.py プロジェクト: jacobgithub/udacity253
    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)