Exemple #1
0
 def image_large(cls, model, request):
     try:
         if int(model.type_id) > 2:
             model.img = 'tile/tile_bg.png'
         img = model.img
         url = media_path(img,"large")
         return url
     except Exception, e:
         print e
         return ""
Exemple #2
0
 def image_middle(cls, model, request):
     try:
         if int(model.type_id) > 2:
             model.img = 'tile/tile_bg.png'
         img = model.img
         url = media_path(img,"big")
         
         attr = media_attr(img,"big");
         data = {}
         if url:
             data.update({'url':url})
         if attr:
             data.update({'width':attr['width'],'height':attr['height']}) 
         return data
     except Exception, e:
         print e
         return ""