Exemplo n.º 1
0
 def get(self):
     user=users.get_current_user()
     template_values = {
                         'user':user
                        }
     path = os.path.join(os.path.dirname(__file__), '../html/createprofile.html')
     shared.render(self, path, template_values)
Exemplo n.º 2
0
    def get(self):
        videos=[]
#        tags=set()
        categories=set()
        
        cat=self.request.get('cat')
        logging.info(cat)
        vids=model.video.Video.all().order('-timestamp')
        
        for v in vids.fetch(100):
#            tags=tags.union(set(v.tags))
            categories=categories.union(set(v.categories))
        
        if cat:
            vids.filter("categories = ", cat)
            
        for v in vids.fetch(100):
            videos.append(v)
        
        template_values = {
                           "videos":videos,
#                           "tags":tags,
                           "categories":categories
                           }
        path = os.path.join(os.path.dirname(__file__), '../html/video.html')
        shared.render(self, path, template_values)
Exemplo n.º 3
0
 def get(self):
     stories=[]
     for s in Story.all().order('-timestamp').fetch(100):
         stories.append(s)
     
     template_values = {
                        "stories":stories
                        }
     path = os.path.join(os.path.dirname(__file__), '../html/article.html')
     shared.render(self, path, template_values)
Exemplo n.º 4
0
 def get(self):
     stories=[]
     for s in Story.all().order('-timestamp').fetch(100):
         stories.append(s)
     videos=[]
     for v in Video.all().order('-timestamp').fetch(100):
         videos.append(v)
     
     template_values = {
                        "stories":stories,
                        "videos":videos
                        }
     path = os.path.join(os.path.dirname(__file__), '../html/index.html')
     shared.render(self, path, template_values)
Exemplo n.º 5
0
 def post(self):
     media=self.getMedia(self.request.get('key'))
     if media:
         comment=Comment()
         comment.title=self.request.get('title')
         u=users.get_current_user()
         if u:
             comment.by=u.nickname()
         else:
             comment.by="Mr. I'm too good to log in"
         comment.text=self.request.get('text')
         commentkey=self.request.get('commentkey')
         if commentkey:
             comment.op=Comment.get(commentkey)
         else:
             comment.media=media
         comment.put()
             
         template_values = {"media":media}
         path = os.path.join(os.path.dirname(__file__), '../html/details.html')
         shared.render(self, path, template_values)
Exemplo n.º 6
0
 def get(self):
     media=self.getMedia(self.request.get('key'))
     if media:
         template_values = {"media":media}
         path = os.path.join(os.path.dirname(__file__), '../html/details.html')
         shared.render(self, path, template_values)
Exemplo n.º 7
0
 def get(self):
     template_values = {}
     path = os.path.join(os.path.dirname(__file__), '../html/profile.html')
     shared.render(self, path, template_values)