def setup(self): class Person(object): pass self.Person = Person self.mapper = mapper(Person, FOAF.Person) self.session = Session(helpers.graph('foaf-01.rdf'))
def setup(self): class Person(object): pass self.Person = Person self.mapper = mapper(Person, FOAF.Person, properties={ 'name': Property(FOAF.name), 'mbox': Property(FOAF.mbox) }) self.session = Session(helpers.graph('foaf-01.rdf'))
def stockinfo(): symbol = request.args.get("symbol") financials = [ f"https://www.nasdaq.com/symbol/{urllib.parse.quote_plus(symbol)}/financials?query=income-statement", f"https://www.nasdaq.com/symbol/{urllib.parse.quote_plus(symbol)}/financials?query=balance-sheet", f"https://www.nasdaq.com/symbol/{urllib.parse.quote_plus(symbol)}/financials?query=cash-flow", f"https://www.nasdaq.com/symbol/{urllib.parse.quote_plus(symbol)}/financials?query=ratios"] graphic = graph(symbol) if graphic == apology("Please input a valid symbol."): return apology("Please input a valid symbol.") if request.method == "GET": profile = lookup_2(symbol) return render_template("stockinfo.html", profile=profile, symbol = symbol, financials = financials, graphic = graphic) if request.method == "POST": return redirect ("/index")