def avatar_large(cls, model, request): try: url = model.get_profile().mugshot url = media_path(url, "avatar_large") return url except Exception: return ""
def logo(cls, model, request): try: url = model.logo url = media_path(url,"normal") return url except Exception: return ""
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 ""
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 ""
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 ""