def url(self, category='photo'): return photo_url(category, self.filename)
def avatar_url(self, category='thumb'): if not self.has_avatar(): return 'http://img3.douban.com/icon/ul65647191-17.jpg' from view import photo_url return photo_url(category, self.avatar_filename)
def origin_avatar_url(self): from view import photo_url return photo_url('origin', self.avatar_filename)