当前位置: 首页>>代码示例>>Python>>正文


Python Message.get_by_id方法代码示例

本文整理汇总了Python中models.Message.get_by_id方法的典型用法代码示例。如果您正苦于以下问题:Python Message.get_by_id方法的具体用法?Python Message.get_by_id怎么用?Python Message.get_by_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在models.Message的用法示例。


在下文中一共展示了Message.get_by_id方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: post

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
    def post(self,sporocilo_id):                                # ce hocemo trajno zbrisat sporocilo: sporocilo.key.delete() in potem redirect
        sporocilo = Message.get_by_id(int(sporocilo_id))
        sporocilo.izbrisan = True

        sporocilo.put()

        self.redirect_to("seznam_sporocil")
开发者ID:matejagustin,项目名称:base_jinja,代码行数:9,代码来源:main.py

示例2: post

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
    def post(self, message_id):
        message = Message.get_by_id(int(message_id))
        #message.ime= self.request.get("ime")
        message.email = self.request.get("email")
        message.content = self.request.get("sporocilo")
        message.put()

        self.redirect("/message/" + message_id)
开发者ID:filippotocnik,项目名称:koncni-projekt,代码行数:10,代码来源:main.py

示例3: get

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
    def get(self, message_id):
        message = Message.get_by_id(int(message_id))

        view_vars = {
            "message": message,
        }

        return self.render_template("edit_message.html", view_vars)
开发者ID:filippotocnik,项目名称:koncni-projekt,代码行数:10,代码来源:main.py

示例4: message_delete

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
def message_delete(pk=None):
    """ delete message

    :param pk:
    :return:
    """
    if request.method == 'DELETE':
        msg = Message.get_by_id(pk)
        msg.key.delete()
        return jsonify({
            pk: 'deleted'
        }), 204
    return jsonify({'errors': {}}), 400
开发者ID:tarvitz,项目名称:test-work,代码行数:15,代码来源:views.py

示例5: sendReply

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
def sendReply(user, msg_id, msg, msg_raw, subject, recipient_name, notify):
    message                       = Message.get_by_id(int(msg_id))
    new_message                   = {}
    new_message['sender']         = user
    new_message['subject']        = subject
    new_message['sender_name']    = user.first_name + " " + user.last_name
    new_message['sender_email']   = user.alias
    new_message['receiver']       = message.sender
    new_message['receiver_name']  = recipient_name
    new_message['receiver_email'] = message.sender.email
    new_message['content']        = msg_raw
    new_message['type']           = 'reply_to'
    new_message['category']       = message.sender.user_profile
    new_message['date']           = strftime("%a, %d %b %Y %X +0000", gmtime())
    result                        = outBoundMail(new_message)
    msg                           = Message.create(new_message)
    new_notify                    = sendCopy(new_message, notify)
    user.notify_mail              = notify
    user.put()
    print new_notify
    print result
    return msg
开发者ID:nicodee,项目名称:mestglobalcommunity,代码行数:24,代码来源:mailhandler.py

示例6: post

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
    def post(self, msg_id):
        msg = Message.get_by_id(int(msg_id))

        msg.key.delete()

        return self.redirect_to("home")
开发者ID:Kocl9262,项目名称:ChattyChat,代码行数:8,代码来源:main.py

示例7: get

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
    def get(self, msg_id):
        msg = Message.get_by_id(int(msg_id))

        params = {"msg": msg}

        self.render_template("delete_msg.html", params)
开发者ID:Kocl9262,项目名称:ChattyChat,代码行数:8,代码来源:main.py

示例8: message_get

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
def message_get(pk=None):
    msg = Message.get_by_id(pk)
    return jsonify(msg.to_dict()), 200
开发者ID:tarvitz,项目名称:test-work,代码行数:5,代码来源:views.py

示例9: get

# 需要导入模块: from models import Message [as 别名]
# 或者: from models.Message import get_by_id [as 别名]
 def get(self,sporocilo_id):
     sporocilo = Message.get_by_id(int(sporocilo_id))
     params = {"sporocilo":sporocilo}
     return self.render_template("izbrisi_sporocilo.html",params=params)
开发者ID:matejagustin,项目名称:base_jinja,代码行数:6,代码来源:main.py


注:本文中的models.Message.get_by_id方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。