예제 #1
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self,tagname):
     result = Tag.all().filter('tag', tagname).filter('valid', True)
     tag = result.fetch(limit=1)
     if len(tag) > 0:
         tagname = tag[0].tag
         if users.is_current_user_admin():
             websites = WebSite.all().filter('tags', tagname).order('-created')
         else:
             websites = WebSite.all().filter('tags', tagname).filter('is_public', True).order('-created')
         self.render('tag.html', tag=tagname, websites=websites)
     else:
         self.render('base.html', message='No Such Tag')
예제 #2
0
 def get(self, tagname):
     result = Tag.all().filter('tag', tagname).filter('valid', True)
     tag = result.fetch(limit=1)
     if len(tag) > 0:
         tagname = tag[0].tag
         if users.is_current_user_admin():
             websites = WebSite.all().filter('tags',
                                             tagname).order('-created')
         else:
             websites = WebSite.all().filter('tags', tagname).filter(
                 'is_public', True).order('-created')
         self.render('tag.html', tag=tagname, websites=websites)
     else:
         self.render('base.html', message='No Such Tag')
예제 #3
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self, ws_id):
     website = db.get(ws_id)
     website.is_public=False
     #invalidate the tags?
     tags = website.get_tags()
     newtags = []
     
     for t in tags:
         if WebSite.all().filter('tags', t).count() > 1:
             tg = Tag.all().filter('tag',tag).fetch(1)
             if len(tg)>1: 
                 newtags.append(t)
                 if tg[0].entrycount > 0:
                     tg[0].entrycount -= 1
                     tg[0].put()
                     
     newtags = [t for t in newtags if t != ' ']
     website.tags_spc = ' '.join(newtags)
     website.put()
     self.render('website.html', website=website)
예제 #4
0
    def get(self, ws_id):
        website = db.get(ws_id)
        website.is_public = False
        #invalidate the tags?
        tags = website.get_tags()
        newtags = []

        for t in tags:
            if WebSite.all().filter('tags', t).count() > 1:
                tg = Tag.all().filter('tag', tag).fetch(1)
                if len(tg) > 1:
                    newtags.append(t)
                    if tg[0].entrycount > 0:
                        tg[0].entrycount -= 1
                        tg[0].put()

        newtags = [t for t in newtags if t != ' ']
        website.tags_spc = ' '.join(newtags)
        website.put()
        self.render('website.html', website=website)
예제 #5
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def post(self):
     author = users.get_current_user()
     title = escape(self.request.get("title"))
     link = escape(self.request.get("link"))
     description = escape(self.request.get("description"))
     tagsrc = self.request.get("tagsrc")
     srclink = escape(self.request.get("srclink"))
     deschtml = markdown2.markdown(description)
     tags = tagsrc.split(' ')
     
     ws = WebSite(author=author, title=title, link=link,
         description=description, srclink=srclink, is_public=False,
         deschtml=deschtml)
     ws.update_screencap()
     ws.tags_spc = tagsrc
     ws.save()
     self.render('submit_success.html')
예제 #6
0
    def post(self):
        author = users.get_current_user()
        title = escape(self.request.get("title"))
        link = escape(self.request.get("link"))
        description = escape(self.request.get("description"))
        tagsrc = self.request.get("tagsrc")
        srclink = escape(self.request.get("srclink"))
        deschtml = markdown2.markdown(description)
        tags = tagsrc.split(' ')

        ws = WebSite(author=author,
                     title=title,
                     link=link,
                     description=description,
                     srclink=srclink,
                     is_public=False,
                     deschtml=deschtml)
        ws.update_screencap()
        ws.tags_spc = tagsrc
        ws.save()
        self.render('submit_success.html')
예제 #7
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self):
     websites = WebSite.gql('WHERE is_public=False ORDER BY created ')
     self.render('reviewsites.html', websites=websites)
예제 #8
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self, userid):
     websites = WebSite.gql('WHERE is_public=True  and author=:1 ORDER BY created DESC ', userid)
     self.render('userprofile.html', websites=websites)
예제 #9
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self):
     websites = WebSite.gql('WHERE is_public=True  ORDER BY created ')
     self.render('with-source.html')
예제 #10
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self):
     websites = WebSite.gql('WHERE is_public=True ORDER BY votes DESC LIMIT 5')
     self.render('highest-rated.html', websites=websites)
예제 #11
0
파일: webapp.py 프로젝트: btbytes/gappsites
 def get(self):
     websites = WebSite.gql('WHERE is_public=True ORDER BY created DESC')
     self.render('index.html', websites=websites)
예제 #12
0
 def get(self):
     websites = WebSite.gql('WHERE is_public=False ORDER BY created ')
     self.render('reviewsites.html', websites=websites)
예제 #13
0
 def get(self, userid):
     websites = WebSite.gql(
         'WHERE is_public=True  and author=:1 ORDER BY created DESC ',
         userid)
     self.render('userprofile.html', websites=websites)
예제 #14
0
 def get(self):
     websites = WebSite.gql('WHERE is_public=True  ORDER BY created ')
     self.render('with-source.html')
예제 #15
0
 def get(self):
     websites = WebSite.gql(
         'WHERE is_public=True ORDER BY votes DESC LIMIT 5')
     self.render('highest-rated.html', websites=websites)
예제 #16
0
 def get(self):
     websites = WebSite.gql('WHERE is_public=True ORDER BY created DESC')
     self.render('index.html', websites=websites)