def get(self): upload_template = \ jinja_current_directory.get_template('templates/upload.html') token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() current_account = {"logged": logged} self.response.write(upload_template.render(current_account))
def post(self): token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() id = self.request.get("id") i = product = Products.query(Products.id == id).get() self.redirect("/counterupload?current_user="******"&id=" + i.id)
def post(self): token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() dele = self.request.get("del") d = Products.query(Products.id == dele).get() d.key.delete() self.redirect('/welcome?current_user=' + logged.tokens)
def post(self): college = self.request.get("college") size = self.request.get("size") color = self.request.get("color") wid = self.request.get("id") i = Products.query(Products.id == wid).get() counter = i.id neck_type = self.request.get("neck_type") sleeve_type = self.request.get("sleeve_type") picture = self.request.get('img') picture = images.resize(picture, 256, 256) token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() id = id_generator() current_account = {"logged": logged} product = Products(college=college, size=size, color=color, counter=counter, neck_type=neck_type, sleeve_type=sleeve_type, picture=picture, tokens=token, id=id) product.put() self.redirect("/welcome?current_user=" + logged.tokens)
def get(self): home_template = \ jinja_current_directory.get_template('templates/home.html') token = self.request.get("current_user") logged = Accounts.query(Accounts.username == token).get() current_account = {"logged": logged} self.response.write(home_template.render(current_account))
def post(self): for i in Products.query().fetch(): if i.id == self.request.get("tag"): token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() self.redirect("/desc?current_user="******"&id=" + i.id) elif self.request.get("search_btn") == "Search": token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() self.redirect("/marketplace?current_user="******"&size_=" + self.request.get("size") + "&color_=" + self.request.get("color") + "&neck_type_=" + self.request.get("neck_type") + "&sleeve_type_=" + self.request.get("sleeve_type") + "&college_=" + self.request.get("college"))
def post(self): email = self.request.get("email") logged = Accounts.query(Accounts.email == email).get() if self.request.get( "login_btn" ) == "Login" and logged.password == self.request.get("password"): self.redirect('/welcome?current_user='******'/creation')
def post(self): username = self.request.get("username") password = self.request.get("password") query = Accounts.query(Accounts.username == username, Accounts.password == password).fetch() if not query: self.redirect("/loginerror") else: self.redirect("/home?current_user=" + username)
def post(self): for i in Products.query().fetch(): if i.id == self.request.get("tag"): token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() self.redirect("/desc?current_user="******"&id=" + i.id) elif self.request.get("back_btn") == "Go Back": token = self.request.get("current_user") self.redirect("/defmarketplace?current_user=" + token)
def get(self): confirm_template = \ jinja_current_directory.get_template('templates/confirm.html') id = self.request.get("id") dele = self.request.get("del") d = Products.query(Products.id == dele).get() product = Products.query(Products.id == id).get() logged = Accounts.query(Accounts.tokens == product.tokens).get() dict = {"product": product, "logged": logged, "dele": dele} self.response.write(confirm_template.render(dict))
def get(self): reply_template = \ jinja_current_directory.get_template('templates/reply.html') token = self.request.get("current_user") ids = self.request.get("id") logged = Accounts.query(Accounts.tokens == token).get() id = self.request.get("id") offers = Products.query().filter(Products.counter == id).fetch() dict = {"offers": offers, "token": token, "ids": ids} self.response.write(reply_template.render(dict))
def post(self): token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() current_account = {"logged": logged} if self.request.get("upload_btn") == "upload": self.redirect("/upload?current_user="******"status_btn") == "status": self.redirect("/status?current_user="******"market_btn") == "marketplace": self.redirect("/defmarketplace?current_user="******"log_btn") == "Logout": self.redirect("/")
def post(self): username = self.request.get("uName") password = self.request.get("pass") acc = Accounts(Username=username, Password=password) acc.put() var_dict = { "all_acc": Accounts.query().fetch(), "user": username, "pass": password } print(var_dict["all_acc"]) result_template = the_jinja_env.get_template('/HTML/search.html') self.response.write(result_template.render(var_dict))
def get(self): status_template = \ jinja_current_directory.get_template('templates/status.html') token = self.request.get("current_user") logged = Accounts.query(Accounts.tokens == token).get() request = Products.query().filter(Products.tokens == logged.tokens, Products.counter != "").fetch() requests = [] for i in request: requests.append( Products.query().filter(Products.id == i.counter).get()) offers = Products.query().filter(Products.tokens == logged.tokens, Products.counter == "").fetch() dict = {"requests": requests, "offers": offers, "token": token} self.response.write(status_template.render(dict))