本文整理汇总了Python中models.Sporocilo.get_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python Sporocilo.get_by_id方法的具体用法?Python Sporocilo.get_by_id怎么用?Python Sporocilo.get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Sporocilo
的用法示例。
在下文中一共展示了Sporocilo.get_by_id方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def post(self, sporocilo_id):
sporocilo = Sporocilo.get_by_id(int(sporocilo_id))
sporocilo.izbrisan = True
sporocilo.put()
self.redirect_to("seznam")
示例2: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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")
示例3: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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)
示例4: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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")
示例5: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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')
示例6: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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)
示例7: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
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)
示例8: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def post(self, sporocilo_id):
pos_sporocilo = Sporocilo.get_by_id(int(sporocilo_id))
obdelan = self.request.get('obdelan')
if obdelan == 'yes' :
pos_sporocilo.obdelan = 'Obdelan'
pos_sporocilo.put()
elif obdelan == 'progress':
pos_sporocilo.obdelan == 'V obdelavi'
pos_sporocilo.put()
elif obdelan == 'spam':
pos_sporocilo.obdelan == 'Nepomembno'
pos_sporocilo.put()
else:
pos_sporocilo.obdelan == ' '
pos_sporocilo.put()
return self.redirect_to('admin')
示例9: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def post(self, sporocilo_id):
vnos = self.request.get("vnos")
sporocilo = Sporocilo.get_by_id(int(sporocilo_id))
sporocilo.vnos = vnos
sporocilo.put()
self.redirect_to("seznam-sporocil")
示例10: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def get(self, note_id):
note = Sporocilo.get_by_id(int(note_id))
params = {"note": note}
self.render_template("uredi.html", params)
示例11: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def get(self,shranjeno_sporocilo_id):
shranjeno_sporocilo=Sporocilo.get_by_id(int(shranjeno_sporocilo_id))
params={"shranjeno_sporocilo":shranjeno_sporocilo}
return self.render_template("posamezno-sporocilo.html", params=params)
示例12: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def post(self, sporocilo_id):
ime = self.request.get("ime")
sporocilo = Sporocilo.get_by_id(int(sporocilo_id))
sporocilo.ime = ime
sporocilo.put()
self.redirect_to("seznam-sporocil")
示例13: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import get_by_id [as 别名]
def get(self, sporocilo_id):
sporocilo = Sporocilo.get_by_id(int(sporocilo_id))
params = {"sporocilo": sporocilo}
self.render_template("posamezno_sporocilo.html", params=params)