本文整理汇总了Python中boto.sdb.domain.Domain类的典型用法代码示例。如果您正苦于以下问题:Python Domain类的具体用法?Python Domain怎么用?Python Domain使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Domain类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: save_entity
def save_entity(connection, model, data):
domain_name = domain_for_model(model)
manager = connection.create_manager(domain_name)
attrs = {
'__type__': domain_name,
}
attrs.update(data)
if not attrs.has_key('_id'):
# New item. Generate an ID.
attrs['_id'] = uuid.uuid4().int
domain = Domain(name=domain_name, connection=manager.sdb)
domain.put_attributes(attrs['_id'], attrs, replace=True)
return attrs['_id']
示例2: get_item
def get_item(self, item_name):
"""Uses `consistent_read` by default."""
# Domain is an old-style class, can't use super().
for consistent_read in (False, True):
item = Domain.get_item(self, item_name, consistent_read)
if item:
return item
示例3: select
def select(self, query='', next_token=None,
consistent_read=True, max_items=None):
"""Uses `consistent_read` by default."""
query = """SELECT * FROM `%s` %s""" % (self.name, query)
return Domain.select(self, query, next_token,
consistent_read, max_items)