예제 #1
0
파일: like.py 프로젝트: orchestor/diggit
 def post(self):
     self.set_header("Content-Type", "application/json")
     r = {'code': 500}
     photo_id = self.get_argument('photo_id')
     if photo_id:
         photo = Photo.get(photo_id)
         if photo:
             photo.inc_like_count()
             r = {
                 'code': 200,
                 'like_count': photo.like_count,
                 'photo_id': photo_id
             }
     self.write(r)
     self.finish()
예제 #2
0
 def photo(self):
     return self.photo_id and Photo.get(self.photo_id)
예제 #3
0
파일: album.py 프로젝트: cheshang/cheshang
 def cover_link(self):
     p = Photo.get(album_id=self.id)
     return p.link if p else ''