Exemple #1
0
 def getPinDetail(self,key):        
     board = Board()
     user = User()
     thumb = Thumb()        
     pic = Pic()        
     comment = Comment()    
     
     marks_dict = []
     pin = self.get(key)
     _pin = {}
     _pin['pin']               = self.get(key)
     _pin['user']              = user.getDetail(pin['user'])
     _pin['pin']['pic']        = pic.get(pin['key'])['url']
     
     
     _pin['board']             = board.getDetailWithPinThumb(pin['board']) 
     
     _pin['comments']         = comment.getByPin( pin['key'])           
         
     return _pin
Exemple #2
0
 def formatPins(self,data):        
     board = Board()
     user = User()
     thumb = Thumb()
     comment = Comment()    
     
     marks_dict = []
     
     for pin in data:
         _pin = {}
         _pin['pin']               = pin
         _pin['user']              = user.getDetail(pin['user'])
         _pin['thumb']             = thumb.get(pin['key'])
         
         _pin['board']             = board.getDetail(pin['board']) 
         #print _pin['board']
         _pin['comments']         = comment.getByPin( pin['key'])
         
         marks_dict.append(_pin)
         
     return marks_dict