def post(self): sporocilo = self.request.get("vnos") sporocilo_v_bazi = Sporocilo(besedilo=sporocilo) sporocilo_v_bazi.put() return self.write("Vpisal si: " + sporocilo)
def post(self): rezultat = self.request.get("vnos") sporocilo = Sporocilo(vnos=rezultat) sporocilo.put() self.write(rezultat)
def post(self): ime = self.request.get("ime") or "Anonimnež" vnos = self.request.get("vnos") nastanek = datetime.now().strftime("%d-%m-%Y ob %H.%M.%S") sporocilo = Sporocilo(ime=ime, vnos=vnos, nastanek=nastanek) sporocilo.put() return self.redirect_to("prva")
def post(self): cookie_value = self.request.cookies.get( "uid") # po cookie-u dobimo ID posiljatelja posiljatelj_id, _, _ = cookie_value.split( ":") # po cookie-u dobimo ID posiljatelja posiljatelj_id = int( posiljatelj_id) # po cookie-u dobimo ID posiljatelja posiljatelj = Uporabnik.get_by_id( posiljatelj_id).ime # po ID-ju dobimo ime posiljatelja !!! ime_uporabnika = self.request.get("prejemnik") prejemnik = Uporabnik.gql( "WHERE ime ='" + ime_uporabnika + "'").get() # dobimo ime uporabnika (prejemnika) iz baze s GET() prejemnik = prejemnik.key.id() # ID prejemnika naslov = self.request.get("naslov") vsebina = self.request.get("vsebina") # datum = self.request.get("nastanek") # datume generira avtomaticno vsebina = cgi.escape(vsebina) # prepreci javascript injection sporocilo = Sporocilo(naslov_sporocila=naslov, vsebina_sporocila=vsebina, id_posiljatelja=posiljatelj_id, id_prejemnika=prejemnik, ime_posiljatelja=posiljatelj, ime_prejemnika=ime_uporabnika) sporocilo.put() return self.write( "You have successfully sent a message ...click back on your browser" )
def post(self): dodatno = "Uporabnik je vpisal: " rezultat = self.request.get("vnos") skupaj = dodatno + rezultat # zdruzimo zgornja dva stringa v enega params = {"vnos": skupaj} sporocilo = Sporocilo(vnos=rezultat) sporocilo.put() return self.render_template("hello.html", params=params)
def post(self): dodatno = "Uporabnik je vpisal: " rezultat = self.request.get("vnos") skupaj = dodatno + rezultat # zdruzimo zgornja dva stringa v enega params = {"vnos" : skupaj } sporocilo = Sporocilo(vnos=rezultat) sporocilo.put() return self.render_template("hello.html" , params=params)
def post(self): sporocilo = self.request.get('sporocilo') sporocilo = Sporocilo(sporocilo=sporocilo) potrditev = "Hvala za tvoje sporocilo :)" sporocilo.put() params = {'potrditev': potrditev} return self.render_template('contact.html', params=params)
def post(self): imeM = self.request.get("ime") priimekM = self.request.get("priimek") emailM = self.request.get("email") sporociloM = self.request.get("sporociloV") sporocilo = Sporocilo(ime=imeM, priimek=priimekM, email=emailM, sporocilo=sporociloM) sporocilo.put() self.write("Posiljanje uspesno")
def post(self): rezultat = self.request.get("input-sporocilo") sporocilo = Sporocilo(besedilo=rezultat) sporocilo.put() # sporocilo shranimo (definiran v modelu ndb) return self.write(rezultat)
def post(self): user_name = self.request.get("user_name") user_email = self.request.get("user_email") user_message = self.request.get("user_message") message = Sporocilo(ime = user_name, email = user_email, sporocilo= user_message) message.put() return self.render_template("message-sent.html")
def post(self): sporocilo = self.request.get("sporocilo") ime = self.request.get("ime") # Shrani sporocilo in ime v bazo. spr = Sporocilo(vnos=sporocilo, ime=ime) spr.put() return self.write("Hvala za vaše sporočilo.")
def post(self): sporocilo = self.request.get("sporocilo") user = users.get_current_user() sporocilo_db = Sporocilo(vnos=sporocilo, avtor=user.email()) sporocilo_db.put() self.redirect("/seznam")
def post(self): tekst = self.request.get("sporocilo") prejemnik1 = self.request.get("prejemnik") sporocilo = Sporocilo(vnos=tekst, prejemnik=prejemnik1) #prejemnik je iz models sporocilo.put() params = {"sporocilo": sporocilo} self.redirect_to("main")
def post(self): sporocilo = self.request.get('sporocilo') sporocilo = Sporocilo(sporocilo=sporocilo) potrditev = "Hvala za tvoje sporocilo :)" sporocilo.put() params = {'potrditev':potrditev} return self.render_template('contact.html', params=params)
def post(self): params = {} opravilo = self.request.get("opravilo") avtor = self.request.get("avtor") seznam = Sporocilo(opravilo=opravilo, avtor=avtor) seznam.put() self.redirect("/ToDoBaza")
def post(self): dodatno = ' je vpisal: ' rezultat = self.request.get('vnos') sporocilo = Sporocilo(vnos=rezultat) sporocilo.put() skupaj = dodatno + rezultat # zdruzimo zgornja dva stringa v enega return self.write(skupaj)
def post(self): posiljatelj = cgi.escape(self.request.get("posiljatelj")) prejemnik = cgi.escape(self.request.get("prejemnik")) sporocilo = cgi.escape(self.request.get("sporocilo")) spr = Sporocilo(posiljatelj=posiljatelj, prejemnik=prejemnik, sporocilo=sporocilo) spr.put() return self.redirect("/poslji")
def post(self): tisto_kar_smo_vnseli_v_vnos = self.request.get('vnos') tisto_kar_smo_vnseli_v_avtor = self.request.get('avtor') nov_vnos = Sporocilo(vnos=tisto_kar_smo_vnseli_v_vnos, avtor=tisto_kar_smo_vnseli_v_avtor) nov_vnos.put() self.redirect("/baza")
def post(self): uporabnikovo_ime = self.request.get("ime") uporabnikovo_sporocilo = self.request.get("sporocilo") uporabnikov_email = self.request.get("email") sporocilo = Sporocilo(ime=uporabnikovo_ime, tekst=uporabnikovo_sporocilo, email = uporabnikov_email) sporocilo.put() return self.render_template("sporocilo-poslano.html")
def post(self): sender = self.request.get("Posiljatelj") recipient = self.request.get("Naslovnik") message_ = self.request.get("Message") sporocilo = Sporocilo(Posiljatelj = sender, Naslovnik = recipient, Message = message_) sporocilo.put() self.write("Sporocilo je bilo uspesno poslano")
def post(self): user=users.get_current_user() email=user.email() naslovnik=self.request.get("naslovnik") sporocilo=self.request.get("sporocilo") sporocilo_object=Sporocilo(naslovnik=naslovnik, email=email, vnos=sporocilo) sporocilo_object.put() return self.redirect_to("seznam-sporocil")
def post(self): sporocilo = cgi.escape(self.request.get('sporocilo')) ime = cgi.escape(self.request.get("ime")) # Shrani sporocilo v bazo. spr = Sporocilo(vnos=sporocilo, ime=ime) spr.put() return self.write("Shranjeno.")
def post(self): ime = raw_input(self.request.get("ime")) priimek = raw_input(self.request.get("priimek")) email = raw_input(self.request.get("email")) sporocilo = raw_input(self.request.get("sporocilo")) nov_komentar = Sporocilo(ime=ime, priimek=priimek, email=email, sporocilo=sporocilo) nov_komentar.put() self.write(nov_komentar)
def post(self): besedilo = self.request.get("sporocilo") email = self.request.get("email") ime = self.request.get("ime") if len(ime) == 0: ime = "neznanec" sporocilo = Sporocilo(besedilo_sporocila=besedilo, email=email, avtor=ime) sporocilo.put() return self.render_template("rezultat.html")
def post(self): name = self.request.get("name") mail = self.request.get("mail") text = self.request.get("text") sporocilo = Sporocilo(name=name, mail=mail, text=text) sporocilo.put() self.render_template("rezultat.html")
def post(self): dodatno = "Uporabnik je vpisal: " rezultat = self.request.get("vnos") sporocilo = Sporocilo(vnos=rezultat) sporocilo.put() skupaj = dodatno + rezultat params = {'skupaj': skupaj} return self.render_template("hello.html", params=params)
def post(self): sender = self.request.get("Posiljatelj") recipient = self.request.get("Naslovnik") message_ = self.request.get("Message") sporocilo = Sporocilo(Posiljatelj=sender, Naslovnik=recipient, Message=message_) sporocilo.put() self.write("Sporocilo je bilo uspesno poslano")
def post(self): vnos = self.request.get('vnos') sporocilo = Sporocilo( vnos=vnos ) #inicializiramo sporocilo ki mu damo kar smo poslali v formi sporocilo.put() #za shrant #sporocila = Sporocilo.query(Sporocilo.izbrisan == False).fetch() # ukaz za potegnemo sporocilo iz baze #params = {"sporocila": sporocila} #return self.render_template("seznam_sporocil.html", params=params) return self.redirect_to('seznam_sporocil')
def post(self): uporabnikovo_ime = self.request.get("ime") uporabnikovo_sporocilo = self.request.get("sporocilo") uporabnikovo_ime = cgi.escape(uporabnikovo_ime) uporabnikovo_sporocilo = cgi.escape(uporabnikovo_sporocilo) sporocilo = Sporocilo(ime=uporabnikovo_ime, tekst=uporabnikovo_sporocilo) sporocilo.put() self.redirect("/prikazi-sporocila")
def post(self): usr_ime = self.request.get("usr_ime") usr_email = self.request.get("usr_email") usr_sporocilo = self.request.get("usr_sporocilo") if usr_ime == "": usr_ime = "unknown" sporocilo = Sporocilo(ime=usr_ime, email=usr_email, message=usr_sporocilo) sporocilo.put() return self.render_template("message.html")
def post(self): # Tu dobimo vnešeno vsebino katero smo vpisali v input polje v hello.html. # Pomembno je da dostopaš do inputa preko Atributa name="NekiNeki" rezultat = self.request.get("input-sporocilo") # Sporocilo = objekt kateri vsebuje atribut besedilo. # Atributov se lahko doda tudi več, vendar jih moramo imeti v modelu. # Primer: Sporocilo(besedilo=rezultat, avtor="Tisti Nekdo", Kraj="Rovte") sporocilo = Sporocilo(besedilo=rezultat) sporocilo.put() # Še izpišemo v Browserju (self.write(NekiNeki) return self.write(rezultat)
def post(self): besedilo = self.request.get("sporocilo") ime = self.request.get("ime") email = self.request.get("email") sporocilo = Sporocilo(besedilo_sporocila=besedilo, avtor=ime, email=email) sporocilo.put() stevilka = self.request.get("stevilka") params = {"name": ime, "besede": besedilo, "izzrebane": email} return self.render_template("rezultat.html", params=params)
def post(self): ime = self.request.get("ime") email = self.request.get("email") sporocilo = self.request.get("sporocilo") sp = Sporocilo(ime=ime, email=email, sporocilo=sporocilo) sp.put() # sends to database #return self.write("Vnesel si: '{}'".format(vnos)) rezultat_izpis = "{}, hvala za sporocilo!".format(ime) params = { "rezultat": rezultat_izpis, "povratni_url": "/", "heading": "Hvala!" } return self.render_template("prikazi_rezultat.html", params=params)
def post(self): sporocilo = cgi.escape(self.request.get('sporocilo')) user = users.get_current_user() if user: ime = user.nickname() # Shrani sporocilo v bazo. spr = Sporocilo(vnos=sporocilo, ime=ime) spr.put() return self.write("Shranjeno.") else: return self.write("Ni ti uspelo.")
def post(self): ime = self.request.get("ime") email = self.request.get("email") sporocilo = self.request.get("sporocilo") if ime == "": ime = "Neznanec" if email == "": email = "Neizpolnjen" sporocilo1 = Sporocilo(ime=ime, email=email, sporocilo=sporocilo) sporocilo1.put() self.render_template("poslano.html")
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) sporocilo.izbrisan = True sporocilo.put() self.redirect_to("seznam")
def get(self): vsa_sporocila = Sporocilo.query(Sporocilo.izbrisano == False).fetchsa_sporocila() params = {"sporocila": vsa_sporocila} return self.render_template("vsa_sprocila.html", params=params)
def get(self): sporocila = Sporocilo.query().fetch() params ={"sporocila": sporocila} self.render_template("vsa_sporocila.html", params=params)
def get(self): name = "Bucman" # params = {"name": name} # params = None rezultat = Sporocilo.query().fetch() params = {"name": name, "sporocila": rezultat} return self.render_template("omeni.html", params=params)
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) # sporocilo.key.delete() sporocilo.izbrisan = True sporocilo.put() time.sleep(0.1) return self.redirect_to("seznam-sporocil")
def post(self, deleted_note_id): deleted_note = Sporocilo.get_by_id(int(deleted_note_id)) deleted_note.izbrisano = False deleted_note.put() return self.redirect_to("izbrisana_sporocila")
def get(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) params = {"sporocilo": sporocilo} return self.render_template("izbrisi_sporocilo.html", params=params)
def post(self, note_id): note = Sporocilo.get_by_id(int(note_id)) note.izbrisano = True note.put() return self.redirect_to("sporocila")
def post(self, sporocilo_id): novo_besedilo = self.request.get("besedilo") sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) sporocilo.besedilo = novo_besedilo sporocilo.put() return self.redirect_to("seznam-sporocil")
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) sporocilo.ime = cgi.escape(self.request.get("ime")) sporocilo.email = cgi.escape(self.request.get("email")) sporocilo.sporocilo = cgi.escape(self.request.get("sporocilo")) sporocilo.put() return self.redirect("/vsa-sporocila")
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) nova_vsebina = self.request.get("sporocilo") sporocilo.vnos = nova_vsebina sporocilo.put() return self.redirect("/seznam")
def post(self): zadeva = self.request.get("zadeva") tekst = self.request.get("tekst") email_prejemnika = self.request.get("email_prejemnika") zadeva = cgi.escape(zadeva) tekst = cgi.escape(tekst) cookie_value = self.request.cookies.get("uid") uporabnik_id, _, _ = cookie_value.split(":") uporabnik_id = int(uporabnik_id) prejemnik = Uporabnik.gql("WHERE email='"+ email_prejemnika +"'").get() prejemnik_id= prejemnik.key.id() sporocilo = Sporocilo(uporabnik_id=uporabnik_id, prejemnik_id=prejemnik_id, email_prejemnika=email_prejemnika ,zadeva=zadeva, tekst=tekst) sporocilo.put() self.redirect("/prikazi-sporocila")
def get(self): cookie_value = self.request.cookies.get("uid") uporabnik_id, _, _ = cookie_value.split(":") uporabnik_id = int(uporabnik_id) #uporabnik = Uporabnik.get_by_id(int(uporabnik_id)) prejeta_sporocila = Sporocilo.gql("WHERE prejemnik_id="+ str(uporabnik_id)).order(-Sporocilo.nastanek).fetch() poslana_sporocila = Sporocilo.gql("WHERE uporabnik_id="+ str(uporabnik_id)).order(-Sporocilo.nastanek).fetch() view_vars = { "prejeta_sporocila": prejeta_sporocila, "poslana_sporocila": poslana_sporocila, } return self.render_template("prikazi_sporocila.html", view_vars)
def get(self, sporocilo_id): uporabnik = users.get_current_user() if uporabnik: pos_sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) params = {'uporabnik': uporabnik, 'sporocilo': pos_sporocilo} return self.render_template('sporocilo_podrobno.html', params=params) else: return self.redirect_to('prijava')
def get(self): uporabnik = users.get_current_user() if uporabnik: seznam_sporocil = Sporocilo.query().order(-Sporocilo.nastanek).fetch() params = {'seznam': seznam_sporocil, 'uporabnik':uporabnik} return self.render_template('admin.html', params=params) else: self.redirect_to('prijava')
def get(self): vsa_sporocila = Sporocilo.query().order(Sporocilo.nastanek).fetch() view_vars = { "vsa_sporocila": vsa_sporocila, } return self.render_template("prikazi_sporocila.html", view_vars)
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) sporocilo.ime = self.request.get("ime") sporocilo.email = self.request.get("email") sporocilo.tekst = self.request.get("sporocilo") sporocilo.put() self.redirect("/sporocilo/" + sporocilo_id)
def get(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) view_vars = { "sporocilo": sporocilo } return self.render_template("izbrisi_sporocilo.html", view_vars)
def post(self, sporocilo_id): sporocilo = Sporocilo.get_by_id(int(sporocilo_id)) sporocilo.izbrisano = True sporocilo.put() return self.redirect_to("seznam-sporocil")
def post(self): uporabnik = users.get_current_user() vzdevek = uporabnik.nickname() email = uporabnik.email() msg = self.request.get('sporocilo') danes = datetime.datetime.now() datum = self.trenutni_datum_cas() sporocilo = Sporocilo(sporocilo=msg, vzdevek=vzdevek, email=email, nastanek=datum) potrditev = "Hvala za tvoje sporocilo :)" sporocilo.put() # sporocila iz kontaktnega obrazca dobim na mail e_posta = mail.EmailMessage(sender=email, to='*****@*****.**', subject="Kontakt sporocilo iz domace strani od %s" % vzdevek, body=msg) e_posta.send() params = {'potrditev':potrditev, 'uporabnik':uporabnik} return self.render_template('contact.html', params=params)
def post(self): search_query = self.request.get("search_parameter") seznam = Sporocilo.query(Sporocilo.izbrisan == False).fetch() logging.info(seznam) filtered_list = [] for name in seznam: person_name = name.vnos if person_name.startswith(search_query): filtered_list.append(name) params = {"seznam": filtered_list} self.render_template("seznam_sporocil.html", params=params)
def post(self): sporocilo = Sporocilo() sporocilo.ime_priimek = self.request.get("ime_priimek") sporocilo.email = self.request.get("email") sporocilo.tekst = self.request.get("tekst") sporocilo.put() self.render("rezultat.html")