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'
评论列表
文章目录