Exemplo n.º 1
0
 def avatar_large(cls, model, request):
     try:
         url = model.get_profile().mugshot
         url = media_path(url, "avatar_large")
         return url
     except Exception:
         return ""
Exemplo n.º 2
0
 def logo(cls, model, request):
     try:
         url = model.logo
         url = media_path(url,"normal")
         return url
     except Exception:
         return ""
Exemplo n.º 3
0
 def img(cls, model, request):
     try:
         url = model.img
         url = media_path(url,"normal")
         return url
         #return model.img.url
     except Exception, e:
         # FIXME: return the defualt image
         logger.warning(e)
         return ""
Exemplo n.º 4
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 ""
Exemplo n.º 5
0
 def image(cls, model, request):
     try:
         if int(model.type_id) > 2:
             model.img = 'tile/tile_bg.png'
         img = model.img
         url = media_path(img,"normal")
         attr = media_attr(img,"normal")
         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 ""