€cdocutils.nodes document q)q}q(U nametypesq}q(XsimpledbqˆXcreating domainsqNXdeleting domainsqNXretrieving itemsq NX#deleting items (and its attributes)q NXcreating a connectionq NXgetting domain metadataq NXupdating item attributesq NXadding items (and attributes)qNXretrieving one or more itemsqNXlisting all domainsqNXretrieving a domain (by name)qNX#batch adding items (and attributes)qNX,an introduction to boto's simpledb interfaceqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUsimpledbqhUcreating-domainsqhUdeleting-domainsqh Uretrieving-itemsq h U!deleting-items-and-its-attributesq!h Ucreating-a-connectionq"h Ugetting-domain-metadataq#h Uupdating-item-attributesq$hUadding-items-and-attributesq%hUretrieving-one-or-more-itemsq&hUlisting-all-domainsq'hUretrieving-a-domain-by-nameq(hU!batch-adding-items-and-attributesq)hU,an-introduction-to-boto-s-simpledb-interfaceq*uUchildrenq+]q,(cdocutils.nodes comment q-)q.}q/(U rawsourceq0X simpledb_tut:Uparentq1hUsourceq2XB/Users/kyleknap/Documents/GitHub/boto/docs/source/simpledb_tut.rstq3Utagnameq4Ucommentq5U attributesq6}q7(U xml:spaceq8Upreserveq9Uidsq:]Ubackrefsq;]Udupnamesq<]Uclassesq=]Unamesq>]uUlineq?KUdocumentq@hh+]qAcdocutils.nodes Text qBX simpledb_tut:qC…qD}qE(h0Uh1h.ubaubcdocutils.nodes section qF)qG}qH(h0Uh1hh2h3h4UsectionqIh6}qJ(h<]h=]h;]h:]qKh*ah>]qLhauh?Kh@hh+]qM(cdocutils.nodes title qN)qO}qP(h0X,An Introduction to boto's SimpleDB interfaceqQh1hGh2h3h4UtitleqRh6}qS(h<]h=]h;]h:]h>]uh?Kh@hh+]qThBX,An Introduction to boto's SimpleDB interfaceqU…qV}qW(h0hQh1hOubaubcdocutils.nodes paragraph qX)qY}qZ(h0X‰This tutorial focuses on the boto interface to AWS' SimpleDB_. This tutorial assumes that you have boto already downloaded and installed.h1hGh2h3h4U paragraphq[h6}q\(h<]h=]h;]h:]h>]uh?Kh@hh+]q](hBX4This tutorial focuses on the boto interface to AWS' q^…q_}q`(h0X4This tutorial focuses on the boto interface to AWS' h1hYubcdocutils.nodes reference qa)qb}qc(h0X SimpleDB_UresolvedqdKh1hYh4U referenceqeh6}qf(UnameXSimpleDBUrefuriqgXhttp://aws.amazon.com/simpledb/qhh:]h;]h<]h=]h>]uh+]qihBXSimpleDBqj…qk}ql(h0Uh1hbubaubhBXL. This tutorial assumes that you have boto already downloaded and installed.qm…qn}qo(h0XL. This tutorial assumes that you have boto already downloaded and installed.h1hYubeubcdocutils.nodes target qp)qq}qr(h0X-.. _SimpleDB: http://aws.amazon.com/simpledb/U referencedqsKh1hGh2h3h4Utargetqth6}qu(hghhh:]qvhah;]h<]h=]h>]qwhauh?K h@hh+]ubcdocutils.nodes note qx)qy}qz(h0XËIf you're starting a new application, you might want to consider using :doc:`DynamoDB2 ` instead, as it has a more comprehensive feature set & has guaranteed performance throughput levels.h1hGh2h3h4Unoteq{h6}q|(h<]h=]h;]h:]h>]uh?Nh@hh+]q}hX)q~}q(h0XËIf you're starting a new application, you might want to consider using :doc:`DynamoDB2 ` instead, as it has a more comprehensive feature set & has guaranteed performance throughput levels.h1hyh2h3h4h[h6}q€(h<]h=]h;]h:]h>]uh?Kh+]q(hBXGIf you're starting a new application, you might want to consider using q‚…qƒ}q„(h0XGIf you're starting a new application, you might want to consider using h1h~ubcsphinx.addnodes pending_xref q…)q†}q‡(h0X :doc:`DynamoDB2 `qˆh1h~h2h3h4U pending_xrefq‰h6}qŠ(UreftypeXdocq‹UrefwarnqŒˆU reftargetqX dynamodb2_tutU refdomainUh:]h;]U refexplicitˆh<]h=]h>]UrefdocqŽX simpledb_tutquh?Kh+]qcdocutils.nodes literal q‘)q’}q“(h0hˆh6}q”(h<]h=]q•(Uxrefq–h‹eh;]h:]h>]uh1h†h+]q—hBX DynamoDB2q˜…q™}qš(h0Uh1h’ubah4Uliteralq›ubaubhBXd instead, as it has a more comprehensive feature set & has guaranteed performance throughput levels.qœ…q}qž(h0Xd instead, as it has a more comprehensive feature set & has guaranteed performance throughput levels.h1h~ubeubaubhF)qŸ}q (h0Uh1hGh2h3h4hIh6}q¡(h<]h=]h;]h:]q¢h"ah>]q£h auh?Kh@hh+]q¤(hN)q¥}q¦(h0XCreating a Connectionq§h1hŸh2h3h4hRh6}q¨(h<]h=]h;]h:]h>]uh?Kh@hh+]q©hBXCreating a Connectionqª…q«}q¬(h0h§h1h¥ubaubhX)q­}q®(h0X‰The first step in accessing SimpleDB is to create a connection to the service. To do so, the most straight forward way is the following::h1hŸh2h3h4h[h6}q¯(h<]h=]h;]h:]h>]uh?Kh@hh+]q°hBXˆThe first step in accessing SimpleDB is to create a connection to the service. To do so, the most straight forward way is the following:q±…q²}q³(h0XˆThe first step in accessing SimpleDB is to create a connection to the service. To do so, the most straight forward way is the following:h1h­ubaubcdocutils.nodes literal_block q´)qµ}q¶(h0Xâ>>> import boto.sdb >>> conn = boto.sdb.connect_to_region( ... 'us-west-2', ... aws_access_key_id='', ... aws_secret_access_key='') >>> conn SDBConnection:sdb.amazonaws.com >>>h1hŸh2h3h4U literal_blockq·h6}q¸(h8h9h:]h;]h<]h=]h>]uh?Kh@hh+]q¹hBXâ>>> import boto.sdb >>> conn = boto.sdb.connect_to_region( ... 'us-west-2', ... aws_access_key_id='', ... aws_secret_access_key='') >>> conn SDBConnection:sdb.amazonaws.com >>>qº…q»}q¼(h0Uh1hµubaubhX)q½}q¾(h0X`Bear in mind that if you have your credentials in boto config in your home directory, the two keyword arguments in the call above are not needed. Also important to note is that just as any other AWS service, SimpleDB is region-specific and as such you might want to specify which region to connect to, by default, it'll connect to the US-EAST-1 region.q¿h1hŸh2h3h4h[h6}qÀ(h<]h=]h;]h:]h>]uh?K h@hh+]qÁhBX`Bear in mind that if you have your credentials in boto config in your home directory, the two keyword arguments in the call above are not needed. Also important to note is that just as any other AWS service, SimpleDB is region-specific and as such you might want to specify which region to connect to, by default, it'll connect to the US-EAST-1 region.qÂ…qÃ}qÄ(h0h¿h1h½ubaubeubhF)qÅ}qÆ(h0Uh1hGh2h3h4hIh6}qÇ(h<]h=]h;]h:]qÈhah>]qÉhauh?K'h@hh+]qÊ(hN)qË}qÌ(h0XCreating DomainsqÍh1hÅh2h3h4hRh6}qÎ(h<]h=]h;]h:]h>]uh?K'h@hh+]qÏhBXCreating DomainsqÐ…qÑ}qÒ(h0hÍh1hËubaubhX)qÓ}qÔ(h0XÂArguably, once you have your connection established, you'll want to create one or more dmains. Creating new domains is a fairly straight forward operation. To do so, you can proceed as follows::h1hÅh2h3h4h[h6}qÕ(h<]h=]h;]h:]h>]uh?K(h@hh+]qÖhBXÁArguably, once you have your connection established, you'll want to create one or more dmains. Creating new domains is a fairly straight forward operation. To do so, you can proceed as follows:q×…qØ}qÙ(h0XÁArguably, once you have your connection established, you'll want to create one or more dmains. Creating new domains is a fairly straight forward operation. To do so, you can proceed as follows:h1hÓubaubh´)qÚ}qÛ(h0X{>>> conn.create_domain('test-domain') Domain:test-domain >>> >>> conn.create_domain('test-domain-2') Domain:test-domain >>>h1hÅh2h3h4h·h6}qÜ(h8h9h:]h;]h<]h=]h>]uh?K+h@hh+]qÝhBX{>>> conn.create_domain('test-domain') Domain:test-domain >>> >>> conn.create_domain('test-domain-2') Domain:test-domain >>>qÞ…qß}qà(h0Uh1hÚubaubhX)qá}qâ(h0X˜Please note that SimpleDB, unlike its newest sibling DynamoDB, is truly and completely schema-less. Thus, there's no need specify domain keys or ranges.qãh1hÅh2h3h4h[h6}qä(h<]h=]h;]h:]h>]uh?K2h@hh+]qåhBX˜Please note that SimpleDB, unlike its newest sibling DynamoDB, is truly and completely schema-less. Thus, there's no need specify domain keys or ranges.qæ…qç}qè(h0hãh1háubaubeubhF)qé}qê(h0Uh1hGh2h3h4hIh6}që(h<]h=]h;]h:]qìh'ah>]qíhauh?K6h@hh+]qî(hN)qï}qð(h0XListing All Domainsqñh1héh2h3h4hRh6}qò(h<]h=]h;]h:]h>]uh?K6h@hh+]qóhBXListing All Domainsqô…qõ}qö(h0hñh1hïubaubhX)q÷}qø(h0X¾Unlike DynamoDB or other database systems, SimpleDB uses the concept of 'domains' instead of tables. So, to list all your domains for your account in a region, you can simply do as follows::h1héh2h3h4h[h6}qù(h<]h=]h;]h:]h>]uh?K7h@hh+]qúhBX½Unlike DynamoDB or other database systems, SimpleDB uses the concept of 'domains' instead of tables. So, to list all your domains for your account in a region, you can simply do as follows:qû…qü}qý(h0X½Unlike DynamoDB or other database systems, SimpleDB uses the concept of 'domains' instead of tables. So, to list all your domains for your account in a region, you can simply do as follows:h1h÷ubaubh´)qþ}qÿ(h0X_>>> domains = conn.get_all_domains() >>> domains [Domain:test-domain, Domain:test-domain-2] >>>h1héh2h3h4h·h6}r(h8h9h:]h;]h<]h=]h>]uh?K:h@hh+]rhBX_>>> domains = conn.get_all_domains() >>> domains [Domain:test-domain, Domain:test-domain-2] >>>r…r}r(h0Uh1hþubaubhX)r}r(h0XÆThe get_all_domains() method returns a :py:class:`boto.resultset.ResultSet` containing all :py:class:`boto.sdb.domain.Domain` objects associated with this connection's Access Key ID for that region.h1héh2h3h4h[h6}r(h<]h=]h;]h:]h>]uh?K?h@hh+]r(hBX'The get_all_domains() method returns a r …r }r (h0X'The get_all_domains() method returns a h1jubh…)r }r (h0X$:py:class:`boto.resultset.ResultSet`rh1jh2h3h4h‰h6}r(UreftypeXclasshŒ‰hXboto.resultset.ResultSetU refdomainXpyrh:]h;]U refexplicit‰h<]h=]h>]hŽhUpy:classrNU py:modulerNuh?K?h+]rh‘)r}r(h0jh6}r(h<]h=]r(h–jXpy-classreh;]h:]h>]uh1j h+]rhBXboto.resultset.ResultSetr…r}r(h0Uh1jubah4h›ubaubhBX containing all r…r}r(h0X containing all h1jubh…)r }r!(h0X":py:class:`boto.sdb.domain.Domain`r"h1jh2h3h4h‰h6}r#(UreftypeXclasshŒ‰hXboto.sdb.domain.DomainU refdomainXpyr$h:]h;]U refexplicit‰h<]h=]h>]hŽhjNjNuh?K?h+]r%h‘)r&}r'(h0j"h6}r((h<]h=]r)(h–j$Xpy-classr*eh;]h:]h>]uh1j h+]r+hBXboto.sdb.domain.Domainr,…r-}r.(h0Uh1j&ubah4h›ubaubhBXI objects associated with this connection's Access Key ID for that region.r/…r0}r1(h0XI objects associated with this connection's Access Key ID for that region.h1jubeubeubhF)r2}r3(h0Uh1hGh2h3h4hIh6}r4(h<]h=]h;]h:]r5h(ah>]r6hauh?KDh@hh+]r7(hN)r8}r9(h0XRetrieving a Domain (by name)r:h1j2h2h3h4hRh6}r;(h<]h=]h;]h:]h>]uh?KDh@hh+]r<hBXRetrieving a Domain (by name)r=…r>}r?(h0j:h1j8ubaubhX)r@}rA(h0XYIf you wish to retrieve a specific domain whose name is known, you can do so as follows::rBh1j2h2h3h4h[h6}rC(h<]h=]h;]h:]h>]uh?KEh@hh+]rDhBXXIf you wish to retrieve a specific domain whose name is known, you can do so as follows:rE…rF}rG(h0XXIf you wish to retrieve a specific domain whose name is known, you can do so as follows:h1j@ubaubh´)rH}rI(h0XG>>> dom = conn.get_domain('test-domain') >>> dom Domain:test-domain >>>h1j2h2h3h4h·h6}rJ(h8h9h:]h;]h<]h=]h>]uh?KGh@hh+]rKhBXG>>> dom = conn.get_domain('test-domain') >>> dom Domain:test-domain >>>rL…rM}rN(h0Uh1jHubaubhX)rO}rP(h0X+The get_domain call has an optional validate parameter, which defaults to True. This will make sure to raise an exception if the domain you are looking for doesn't exist. If you set it to false, it will return a :py:class:`Domain ` object blindly regardless of its existence.h1j2h2h3h4h[h6}rQ(h<]h=]h;]h:]h>]uh?KLh@hh+]rR(hBXÔThe get_domain call has an optional validate parameter, which defaults to True. This will make sure to raise an exception if the domain you are looking for doesn't exist. If you set it to false, it will return a rS…rT}rU(h0XÔThe get_domain call has an optional validate parameter, which defaults to True. This will make sure to raise an exception if the domain you are looking for doesn't exist. If you set it to false, it will return a h1jOubh…)rV}rW(h0X+:py:class:`Domain `rXh1jOh2h3h4h‰h6}rY(UreftypeXclasshŒ‰hXboto.sdb.domain.DomainU refdomainXpyrZh:]h;]U refexplicitˆh<]h=]h>]hŽhjNjNuh?KLh+]r[h‘)r\}r](h0jXh6}r^(h<]h=]r_(h–jZXpy-classr`eh;]h:]h>]uh1jVh+]rahBXDomainrb…rc}rd(h0Uh1j\ubah4h›ubaubhBX, object blindly regardless of its existence.re…rf}rg(h0X, object blindly regardless of its existence.h1jOubeubeubhF)rh}ri(h0Uh1hGh2h3h4hIh6}rj(h<]h=]h;]h:]rkh#ah>]rlh auh?KQh@hh+]rm(hN)rn}ro(h0XGetting Domain Metadatarph1jhh2h3h4hRh6}rq(h<]h=]h;]h:]h>]uh?KQh@hh+]rrhBXGetting Domain Metadatars…rt}ru(h0jph1jnubaubhX)rv}rw(h0X¾There are times when you might want to know your domains' machine usage, aprox. item count and other such data. To this end, boto offers a simple and convenient way to do so as shown below::h1jhh2h3h4h[h6}rx(h<]h=]h;]h:]h>]uh?KRh@hh+]ryhBX½There are times when you might want to know your domains' machine usage, aprox. item count and other such data. To this end, boto offers a simple and convenient way to do so as shown below:rz…r{}r|(h0X½There are times when you might want to know your domains' machine usage, aprox. item count and other such data. To this end, boto offers a simple and convenient way to do so as shown below:h1jvubaubh´)r}}r~(h0XÑ>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta >>> dir(domain_meta) ['BoxUsage', 'DomainMetadataResponse', 'DomainMetadataResult', 'RequestId', 'ResponseMetadata', '__doc__', '__init__', '__module__', 'attr_name_count', 'attr_names_size', 'attr_value_count', 'attr_values_size', 'domain', 'endElement', 'item_count', 'item_names_size', 'startElement', 'timestamp'] >>> domain_meta.item_count 0 >>>h1jhh2h3h4h·h6}r(h8h9h:]h;]h<]h=]h>]uh?KUh@hh+]r€hBXÑ>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta >>> dir(domain_meta) ['BoxUsage', 'DomainMetadataResponse', 'DomainMetadataResult', 'RequestId', 'ResponseMetadata', '__doc__', '__init__', '__module__', 'attr_name_count', 'attr_names_size', 'attr_value_count', 'attr_values_size', 'domain', 'endElement', 'item_count', 'item_names_size', 'startElement', 'timestamp'] >>> domain_meta.item_count 0 >>>r…r‚}rƒ(h0Uh1j}ubaubhX)r„}r…(h0X®Please bear in mind that while in the example above we used a previously retrieved domain object as the parameter, you can retrieve the domain metadata via its name (string).r†h1jhh2h3h4h[h6}r‡(h<]h=]h;]h:]h>]uh?K`h@hh+]rˆhBX®Please bear in mind that while in the example above we used a previously retrieved domain object as the parameter, you can retrieve the domain metadata via its name (string).r‰…rŠ}r‹(h0j†h1j„ubaubeubhF)rŒ}r(h0Uh1hGh2h3h4hIh6}rŽ(h<]h=]h;]h:]rh%ah>]rhauh?Kdh@hh+]r‘(hN)r’}r“(h0XAdding Items (and attributes)r”h1jŒh2h3h4hRh6}r•(h<]h=]h;]h:]h>]uh?Kdh@hh+]r–hBXAdding Items (and attributes)r—…r˜}r™(h0j”h1j’ubaubhX)rš}r›(h0XVOnce you have your domain setup, presumably, you'll want to start adding items to it. In its most straight forward form, you need to provide a name for the item -- think of it as a record id -- and a collection of the attributes you want to store in the item (often a Dictionary-like object). So, adding an item to a domain looks as follows::h1jŒh2h3h4h[h6}rœ(h<]h=]h;]h:]h>]uh?Keh@hh+]rhBXUOnce you have your domain setup, presumably, you'll want to start adding items to it. In its most straight forward form, you need to provide a name for the item -- think of it as a record id -- and a collection of the attributes you want to store in the item (often a Dictionary-like object). So, adding an item to a domain looks as follows:rž…rŸ}r (h0XUOnce you have your domain setup, presumably, you'll want to start adding items to it. In its most straight forward form, you need to provide a name for the item -- think of it as a record id -- and a collection of the attributes you want to store in the item (often a Dictionary-like object). So, adding an item to a domain looks as follows:h1jšubaubh´)r¡}r¢(h0X>>> item_name = 'ABC_123' >>> item_attrs = {'Artist': 'The Jackson 5', 'Genera':'Pop'} >>> dom.put_attributes(item_name, item_attrs) True >>>h1jŒh2h3h4h·h6}r£(h8h9h:]h;]h<]h=]h>]uh?Kjh@hh+]r¤hBX>>> item_name = 'ABC_123' >>> item_attrs = {'Artist': 'The Jackson 5', 'Genera':'Pop'} >>> dom.put_attributes(item_name, item_attrs) True >>>r¥…r¦}r§(h0Uh1j¡ubaubhX)r¨}r©(h0XNow let's check if it worked::rªh1jŒh2h3h4h[h6}r«(h<]h=]h;]h:]h>]uh?Kph@hh+]r¬hBXNow let's check if it worked:r­…r®}r¯(h0XNow let's check if it worked:h1j¨ubaubh´)r°}r±(h0XL>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta.item_count 1 >>>h1jŒh2h3h4h·h6}r²(h8h9h:]h;]h<]h=]h>]uh?Krh@hh+]r³hBXL>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta.item_count 1 >>>r´…rµ}r¶(h0Uh1j°ubaubeubhF)r·}r¸(h0Uh1hGh2h3h4hIh6}r¹(h<]h=]h;]h:]rºh)ah>]r»hauh?Kyh@hh+]r¼(hN)r½}r¾(h0X#Batch Adding Items (and attributes)r¿h1j·h2h3h4hRh6}rÀ(h<]h=]h;]h:]h>]uh?Kyh@hh+]rÁhBX#Batch Adding Items (and attributes)rÂ…rÃ}rÄ(h0j¿h1j½ubaubhX)rÅ}rÆ(h0XàYou can also add a number of items at the same time in a similar fashion. All you have to provide to the batch_put_attributes() method is a Dictionary-like object with your items and their respective attributes, as follows::h1j·h2h3h4h[h6}rÇ(h<]h=]h;]h:]h>]uh?Kzh@hh+]rÈhBXßYou can also add a number of items at the same time in a similar fashion. All you have to provide to the batch_put_attributes() method is a Dictionary-like object with your items and their respective attributes, as follows:rÉ…rÊ}rË(h0XßYou can also add a number of items at the same time in a similar fashion. All you have to provide to the batch_put_attributes() method is a Dictionary-like object with your items and their respective attributes, as follows:h1jÅubaubh´)rÌ}rÍ(h0Xl>>> items = {'item1':{'attr1':'val1'},'item2':{'attr2':'val2'}} >>> dom.batch_put_attributes(items) True >>>h1j·h2h3h4h·h6}rÎ(h8h9h:]h;]h<]h=]h>]uh?K}h@hh+]rÏhBXl>>> items = {'item1':{'attr1':'val1'},'item2':{'attr2':'val2'}} >>> dom.batch_put_attributes(items) True >>>rÐ…rÑ}rÒ(h0Uh1jÌubaubhX)rÓ}rÔ(h0X,Now, let's check the item count once again::rÕh1j·h2h3h4h[h6}rÖ(h<]h=]h;]h:]h>]uh?K‚h@hh+]r×hBX+Now, let's check the item count once again:rØ…rÙ}rÚ(h0X+Now, let's check the item count once again:h1jÓubaubh´)rÛ}rÜ(h0XL>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta.item_count 3 >>>h1j·h2h3h4h·h6}rÝ(h8h9h:]h;]h<]h=]h>]uh?K„h@hh+]rÞhBXL>>> domain_meta = conn.domain_metadata(dom) >>> domain_meta.item_count 3 >>>rß…rà}rá(h0Uh1jÛubaubhX)râ}rã(h0X‹A few words of warning: both batch_put_attributes() and put_item(), by default, will overwrite the values of the attributes if both the item and attribute already exist. If the item exists, but not the attributes, it will append the new attributes to the attribute list of that item. If you do not wish these methods to behave in that manner, simply supply them with a 'replace=False' parameter.räh1j·h2h3h4h[h6}rå(h<]h=]h;]h:]h>]uh?K‰h@hh+]ræhBX‹A few words of warning: both batch_put_attributes() and put_item(), by default, will overwrite the values of the attributes if both the item and attribute already exist. If the item exists, but not the attributes, it will append the new attributes to the attribute list of that item. If you do not wish these methods to behave in that manner, simply supply them with a 'replace=False' parameter.rç…rè}ré(h0jäh1jâubaubeubhF)rê}rë(h0Uh1hGh2h3h4hIh6}rì(h<]h=]h;]h:]ríh ah>]rîh auh?Kh@hh+]rï(hN)rð}rñ(h0XRetrieving Itemsròh1jêh2h3h4hRh6}ró(h<]h=]h;]h:]h>]uh?Kh@hh+]rôhBXRetrieving Itemsrõ…rö}r÷(h0jòh1jðubaubhX)rø}rù(h0XyTo retrieve an item along with its attributes is a fairly straight forward operation and can be accomplished as follows::rúh1jêh2h3h4h[h6}rû(h<]h=]h;]h:]h>]uh?K‘h@hh+]rühBXxTo retrieve an item along with its attributes is a fairly straight forward operation and can be accomplished as follows:rý…rþ}rÿ(h0XxTo retrieve an item along with its attributes is a fairly straight forward operation and can be accomplished as follows:h1jøubaubh´)r}r(h0X1>>> dom.get_item('item1') {u'attr1': u'val1'} >>>h1jêh2h3h4h·h6}r(h8h9h:]h;]h<]h=]h>]uh?K“h@hh+]rhBX1>>> dom.get_item('item1') {u'attr1': u'val1'} >>>r…r}r(h0Uh1jubaubhX)r}r(h0XÖSince SimpleDB works in an "eventual consistency" manner, we can also request a forced consistent read (though this will invariably adversely affect read performance). The way to accomplish that is as shown below::h1jêh2h3h4h[h6}r (h<]h=]h;]h:]h>]uh?K—h@hh+]r hBXÕSince SimpleDB works in an "eventual consistency" manner, we can also request a forced consistent read (though this will invariably adversely affect read performance). The way to accomplish that is as shown below:r …r }r (h0XÕSince SimpleDB works in an "eventual consistency" manner, we can also request a forced consistent read (though this will invariably adversely affect read performance). The way to accomplish that is as shown below:h1jubaubh´)r}r(h0XG>>> dom.get_item('item1', consistent_read=True) {u'attr1': u'val1'} >>>h1jêh2h3h4h·h6}r(h8h9h:]h;]h<]h=]h>]uh?Kšh@hh+]rhBXG>>> dom.get_item('item1', consistent_read=True) {u'attr1': u'val1'} >>>r…r}r(h0Uh1jubaubeubhF)r}r(h0Uh1hGh2h3h4hIh6}r(h<]h=]h;]h:]rh&ah>]rhauh?KŸh@hh+]r(hN)r}r(h0XRetrieving One or More Itemsrh1jh2h3h4hRh6}r(h<]h=]h;]h:]h>]uh?KŸh@hh+]rhBXRetrieving One or More Itemsr …r!}r"(h0jh1jubaubhX)r#}r$(h0X¾Another way to retrieve items is through boto's select() method. This method, at the bare minimum, requires a standard SQL select query string and you would do something along the lines of::h1jh2h3h4h[h6}r%(h<]h=]h;]h:]h>]uh?K h@hh+]r&hBX½Another way to retrieve items is through boto's select() method. This method, at the bare minimum, requires a standard SQL select query string and you would do something along the lines of:r'…r(}r)(h0X½Another way to retrieve items is through boto's select() method. This method, at the bare minimum, requires a standard SQL select query string and you would do something along the lines of:h1j#ubaubh´)r*}r+(h0XŠ>>> query = 'select * from `test-domain` where attr1="val1"' >>> rs = dom.select(query) >>> for j in rs: ... print 'o hai' ... o hai >>>h1jh2h3h4h·h6}r,(h8h9h:]h;]h<]h=]h>]uh?K£h@hh+]r-hBXŠ>>> query = 'select * from `test-domain` where attr1="val1"' >>> rs = dom.select(query) >>> for j in rs: ... print 'o hai' ... o hai >>>r.…r/}r0(h0Uh1j*ubaubhX)r1}r2(h0X@This method returns a ResultSet collection you can iterate over.r3h1jh2h3h4h[h6}r4(h<]h=]h;]h:]h>]uh?K«h@hh+]r5hBX@This method returns a ResultSet collection you can iterate over.r6…r7}r8(h0j3h1j1ubaubeubhF)r9}r:(h0Uh1hGh2h3h4hIh6}r;(h<]h=]h;]h:]r<h$ah>]r=h auh?K®h@hh+]r>(hN)r?}r@(h0XUpdating Item AttributesrAh1j9h2h3h4hRh6}rB(h<]h=]h;]h:]h>]uh?K®h@hh+]rChBXUpdating Item AttributesrD…rE}rF(h0jAh1j?ubaubhX)rG}rH(h0X„The easiest way to modify an item's attributes is by manipulating the item's attributes and then saving those changes. For example::rIh1j9h2h3h4h[h6}rJ(h<]h=]h;]h:]h>]uh?K¯h@hh+]rKhBXƒThe easiest way to modify an item's attributes is by manipulating the item's attributes and then saving those changes. For example:rL…rM}rN(h0XƒThe easiest way to modify an item's attributes is by manipulating the item's attributes and then saving those changes. For example:h1jGubaubh´)rO}rP(h0XR>>> item = dom.get_item('item1') >>> item['attr1'] = 'val_changed' >>> item.save()h1j9h2h3h4h·h6}rQ(h8h9h:]h;]h<]h=]h>]uh?K±h@hh+]rRhBXR>>> item = dom.get_item('item1') >>> item['attr1'] = 'val_changed' >>> item.save()rS…rT}rU(h0Uh1jOubaubeubhF)rV}rW(h0Uh1hGh2h3h4hIh6}rX(h<]h=]h;]h:]rYh!ah>]rZh auh?K·h@hh+]r[(hN)r\}r](h0X#Deleting Items (and its attributes)r^h1jVh2h3h4hRh6}r_(h<]h=]h;]h:]h>]uh?K·h@hh+]r`hBX#Deleting Items (and its attributes)ra…rb}rc(h0j^h1j\ubaubhX)rd}re(h0X¼Deleting an item is a very simple operation. All you are required to provide is either the name of the item or an item object to the delete_item() method, boto will take care of the rest::h1jVh2h3h4h[h6}rf(h<]h=]h;]h:]h>]uh?K¸h@hh+]rghBX»Deleting an item is a very simple operation. All you are required to provide is either the name of the item or an item object to the delete_item() method, boto will take care of the rest:rh…ri}rj(h0X»Deleting an item is a very simple operation. All you are required to provide is either the name of the item or an item object to the delete_item() method, boto will take care of the rest:h1jdubaubh´)rk}rl(h0X >>>dom.delete_item(item) >>>Trueh1jVh2h3h4h·h6}rm(h8h9h:]h;]h<]h=]h>]uh?K»h@hh+]rnhBX >>>dom.delete_item(item) >>>Truero…rp}rq(h0Uh1jkubaubeubhF)rr}rs(h0Uh1hGh2h3h4hIh6}rt(h<]h=]h;]h:]ruhah>]rvhauh?KÁh@hh+]rw(hN)rx}ry(h0XDeleting Domainsrzh1jrh2h3h4hRh6}r{(h<]h=]h;]h:]h>]uh?KÁh@hh+]r|hBXDeleting Domainsr}…r~}r(h0jzh1jxubaubhX)r€}r(h0X\To delete a domain and all items under it (i.e. be very careful), you can do it as follows::r‚h1jrh2h3h4h[h6}rƒ(h<]h=]h;]h:]h>]uh?KÂh@hh+]r„hBX[To delete a domain and all items under it (i.e. be very careful), you can do it as follows:r……r†}r‡(h0X[To delete a domain and all items under it (i.e. be very careful), you can do it as follows:h1j€ubaubh´)rˆ}r‰(h0X.>>> conn.delete_domain('test-domain') True >>>h1jrh2h3h4h·h6}rŠ(h8h9h:]h;]h<]h=]h>]uh?KÄh@hh+]r‹hBX.>>> conn.delete_domain('test-domain') True >>>rŒ…r}rŽ(h0Uh1jˆubaubeubeubeh0UU transformerrNU footnote_refsr}r‘Urefnamesr’}r“Xsimpledb]r”hbasUsymbol_footnotesr•]r–Uautofootnote_refsr—]r˜Usymbol_footnote_refsr™]ršU citationsr›]rœh@hU current_linerNUtransform_messagesrž]rŸUreporterr NUid_startr¡KU autofootnotesr¢]r£U citation_refsr¤}r¥Uindirect_targetsr¦]r§Usettingsr¨(cdocutils.frontend Values r©orª}r«(Ufootnote_backlinksr¬KUrecord_dependenciesr­NU rfc_base_urlr®Uhttp://tools.ietf.org/html/r¯U tracebackr°ˆUpep_referencesr±NUstrip_commentsr²NU toc_backlinksr³Uentryr´U language_coderµUenr¶U datestampr·NU report_levelr¸KU _destinationr¹NU halt_levelrºKU strip_classesr»NhRNUerror_encoding_error_handlerr¼Ubackslashreplacer½Udebugr¾NUembed_stylesheetr¿‰Uoutput_encoding_error_handlerrÀUstrictrÁU sectnum_xformrÂKUdump_transformsrÃNU docinfo_xformrÄKUwarning_streamrÅNUpep_file_url_templaterÆUpep-%04drÇUexit_status_levelrÈKUconfigrÉNUstrict_visitorrÊNUcloak_email_addressesrˈUtrim_footnote_reference_spacer̉UenvrÍNUdump_pseudo_xmlrÎNUexpose_internalsrÏNUsectsubtitle_xformrЉU source_linkrÑNUrfc_referencesrÒNUoutput_encodingrÓUutf-8rÔU source_urlrÕNUinput_encodingrÖU utf-8-sigr×U_disable_configrØNU id_prefixrÙUU tab_widthrÚKUerror_encodingrÛUUTF-8rÜU_sourcerÝh3Ugettext_compactrÞˆU generatorrßNUdump_internalsràNU smart_quotesrá‰U pep_base_urlrâUhttp://www.python.org/dev/peps/rãUsyntax_highlighträUlongråUinput_encoding_error_handlerræjÁUauto_id_prefixrçUidrèUdoctitle_xformré‰Ustrip_elements_with_classesrêNU _config_filesrë]Ufile_insertion_enabledrìˆU raw_enabledríKU dump_settingsrîNubUsymbol_footnote_startrïKUidsrð}rñ(hhqhhÅh)j·h$j9h'héh*hGh jêh(j2h!jVhjrh&jh%jŒh#jhh"hŸuUsubstitution_namesrò}róh4h@h6}rô(h<]h:]h;]Usourceh3h=]h>]uU footnotesrõ]röUrefidsr÷}røub.