uifunc.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:map-of-innovation 作者: AnanseGroup 项目源码 文件源码
def wikipage(self,id=None):
      #Return a wiki for the given space 
      if os.environ.get("REDIS_URL") :
        redis_url = os.environ.get("REDIS_URL")
      else:
        redis_url = "localhost"
      r = redis.from_url(redis_url)
      if id is None :
        return 'Provide a valid space id'
      elif r.exists(id):
        data = r.hgetall(id)
        addresstext = str(data['street_address']).decode("ISO-8859-1")
        websitetext = urllib.unquote(data['primary_website']).decode('utf8')
        return render('/wikipage.html',extra_vars={'last_updated':str(data['last_updated']),'name':str(data['name']),'status':str(data['status']),'website_url':websitetext,'primarytype':str(data['primary_type']),'secondarytype':'','space_description':str(data['description']),'address':addresstext})
      else :
        return 'There is no space with this id. Please recheck and submit'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号