本文整理匯總了Python中rapidsms_httprouter.models.Message.batch方法的典型用法代碼示例。如果您正苦於以下問題:Python Message.batch方法的具體用法?Python Message.batch怎麽用?Python Message.batch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rapidsms_httprouter.models.Message
的用法示例。
在下文中一共展示了Message.batch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: create_message_without_batch
# 需要導入模塊: from rapidsms_httprouter.models import Message [as 別名]
# 或者: from rapidsms_httprouter.models.Message import batch [as 別名]
def create_message_without_batch(self, id, backend):
fake_connection = Connection(identity=str(id))
fake_connection.backend, created = Backend.objects.get_or_create(name=backend)
fake_connection.save()
message = Message(status='Q', direction="O")
message.text = "this is an important message"
message.connection = fake_connection
message.batch = None
message.save()
return message
示例2: create_message
# 需要導入模塊: from rapidsms_httprouter.models import Message [as 別名]
# 或者: from rapidsms_httprouter.models.Message import batch [as 別名]
def create_message(self, id, backend, batch=None):
fake_connection = Connection(identity=str(id))
fake_connection.backend, created = Backend.objects.get_or_create(name=backend)
fake_connection.save()
message = Message(status='Q', direction="O")
message.connection = fake_connection
message.batch = self.batch1 if batch is None else batch
message.save()
return message