def resolve_body(self, info, linkify_images=False): format = prepare_json(self.json_metadata).get('format', 'html') if linkify_images: return utils.linkify_images(self.body, format) else: return self.body
def resolve_avatar(self, info): user = LevelModel.objects(username=self.username, blockchain=self.blockchain).first() meta = prepare_json(user.meta) if 'img' in meta: return meta['img'] else: return "/ava.png"
def resolve_nickname(self, info): user = LevelModel.objects(username=self.username, blockchain=self.blockchain).first() meta = prepare_json(user.meta) if 'nickname' in meta: return meta['nickname'] else: return ""
def resolve_meta(self, info): return prepare_json(self.meta)
def resolve_json_metadata(self, info): User = LevelModel.objects(username=self.username, blockchain=self.blockchain) return prepare_json(self.meta)
def resolve_app(self, info): meta = prepare_json(self) return meta.get('app', 'undefined')
def resolve_tags(self, info): meta = prepare_json(self) return meta.get('tags', [])
def resolve_avatar(self, info): info = prepare_json(self.meta) if 'img' in info: return info['img'] else: return ""
def resolve_info(self, info): # if isinstance(self.meta, BaseDict): return prepare_json(self.meta)