Пример #1
0
 def get(self):
     user = users.get_current_user()
     if not user:
         self.redirect("/")
         
     nameslug = self.request.get('nameslug')
     if not nameslug:
         self.error(404)
         return
     
     ad = doo.getad(nameslug)
     if not ad:
         self.error(404)
         return
     
     if ad.link:
         ad.click()
         self.response.out.write(ad.link)
     else:
         return
Пример #2
0
    def post(self):
        user = users.get_current_user()
        if not user:
            self.redirect("/")

        nameslug = self.request.get('id')
        if not nameslug:
            self.error(404)
            return
        
        ad = doo.getad(nameslug)
        if not ad:
            self.error(404)
            return
        
        ad.view()
        footer = '''<div style="letter-spacing:0px;font-size:11px;color:#999;width:100%;clear:both;display:block;float:none;text-align:left;padding-top:5px;">
        clicking on this ad will open it in a new window
        </div>'''
        content = '%s%s' % (ad.content, footer)
        self.response.out.write(content)