本文整理汇总了Python中models.Sporocilo.query方法的典型用法代码示例。如果您正苦于以下问题:Python Sporocilo.query方法的具体用法?Python Sporocilo.query怎么用?Python Sporocilo.query使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类models.Sporocilo
的用法示例。
在下文中一共展示了Sporocilo.query方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
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)
示例2: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
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)
示例3: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
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')
示例4: post
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
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)
示例5: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
messages = {"listOfMessages": []}
dbMessages = Sporocilo.query(Sporocilo.izbrisan == False).fetch()
for message in dbMessages:
date = message.nastanek
logging.info(date.year)
jsonMessage = {
"content": message.vnos,
"key": message.key.id(),
"date": {"month": message.nastanek.month, "day": message.nastanek.day, "year": message.nastanek.year},
}
messages["listOfMessages"].append(jsonMessage)
jsonMessages = json.dumps(messages, ensure_ascii=False).encode("utf8")
self.write(jsonMessages)
示例6: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
seznam = Sporocilo.query().fetch()
params = {"seznam": seznam}
self.render_template("seznam_sporocil.html", params=params)
示例7: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
seznam = Sporocilo.query(Sporocilo.izbrisan == False).fetch()
params = {"seznam": seznam}
self.render_template("seznam.html", params=params)
示例8: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
sporocila = Sporocilo.query(Sporocilo.izbrisano == False).order(-Sporocilo.created).fetch()
params = {"sporocila": sporocila}
self.render_template("sporocila.html", params)
示例9: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
user = users.get_current_user()
seznam_prejeto = Sporocilo.query(Sporocilo.Naslovnik == user.email()).fetch()
params = {"seznam_prejeto": seznam_prejeto, "user": user}
self.render_template("Prejeto.html", params=params)
示例10: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
uporabnik = str(users.get_current_user())
sporocilo = Sporocilo.query(Sporocilo.from_user)
params = {"sporocilo": sporocilo}
self.render_template("poslano.html", params)
示例11: get
# 需要导入模块: from models import Sporocilo [as 别名]
# 或者: from models.Sporocilo import query [as 别名]
def get(self):
all_messages = Sporocilo.query().order(Sporocilo.nastanek).fetch()
params = {"all_messages": all_messages}
return self.render_template("seznam_sporocil.html", params=params)