€cdocutils.nodes document q)q}q(U nametypesq}q(Xdescribing tablesqNXworking with decimalsqNXdeleting tablesqNXretrieving itemsq NXdeleting itemsq NX,an introduction to boto's dynamodb interfaceq NXupdating itemsq NXcreating a connectionq NX data modelqˆXgetting a tableqNXdynamodbqˆXcreating tablesqNXprovisioned throughputqˆX adding itemsqNXlisting tablesqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUdescribing-tablesqhUworking-with-decimalsqhUdeleting-tablesq h Uretrieving-itemsq!h Udeleting-itemsq"h U,an-introduction-to-boto-s-dynamodb-interfaceq#h Uupdating-itemsq$h Ucreating-a-connectionq%hU data-modelq&hUgetting-a-tableq'hUdynamodbq(hUcreating-tablesq)hUprovisioned-throughputq*hU adding-itemsq+hUlisting-tablesq,uUchildrenq-]q.(cdocutils.nodes comment q/)q0}q1(U rawsourceq2X dynamodb_tut:Uparentq3hUsourceq4XB/Users/kyleknap/Documents/GitHub/boto/docs/source/dynamodb_tut.rstq5Utagnameq6Ucommentq7U attributesq8}q9(U xml:spaceq:Upreserveq;Uidsq<]Ubackrefsq=]Udupnamesq>]Uclassesq?]Unamesq@]uUlineqAKUdocumentqBhh-]qCcdocutils.nodes Text qDX dynamodb_tut:qE…qF}qG(h2Uh3h0ubaubcdocutils.nodes section qH)qI}qJ(h2Uh3hh4h5h6UsectionqKh8}qL(h>]h?]h=]h<]qMh#ah@]qNh auhAKhBhh-]qO(cdocutils.nodes title qP)qQ}qR(h2X,An Introduction to boto's DynamoDB interfaceqSh3hIh4h5h6UtitleqTh8}qU(h>]h?]h=]h<]h@]uhAKhBhh-]qVhDX,An Introduction to boto's DynamoDB interfaceqW…qX}qY(h2hSh3hQubaubcdocutils.nodes paragraph qZ)q[}q\(h2X‰This tutorial focuses on the boto interface to AWS' DynamoDB_. This tutorial assumes that you have boto already downloaded and installed.h3hIh4h5h6U paragraphq]h8}q^(h>]h?]h=]h<]h@]uhAKhBhh-]q_(hDX4This tutorial focuses on the boto interface to AWS' q`…qa}qb(h2X4This tutorial focuses on the boto interface to AWS' h3h[ubcdocutils.nodes reference qc)qd}qe(h2X DynamoDB_UresolvedqfKh3h[h6U referenceqgh8}qh(UnameXDynamoDBUrefuriqiXhttp://aws.amazon.com/dynamodb/qjh<]h=]h>]h?]h@]uh-]qkhDXDynamoDBql…qm}qn(h2Uh3hdubaubhDXL. This tutorial assumes that you have boto already downloaded and installed.qo…qp}qq(h2XL. This tutorial assumes that you have boto already downloaded and installed.h3h[ubeubcdocutils.nodes target qr)qs}qt(h2X-.. _DynamoDB: http://aws.amazon.com/dynamodb/U referencedquKh3hIh4h5h6Utargetqvh8}qw(hihjh<]qxh(ah=]h>]h?]h@]qyhauhAK hBhh-]ubcdocutils.nodes warning qz)q{}q|(h2XThis tutorial covers the **ORIGINAL** release of DynamoDB. It has since been supplanted by a second major version & an updated API to talk to the new version. The documentation for the new version of DynamoDB (& boto's support for it) is at :doc:`DynamoDB v2 `.h3hIh4h5h6Uwarningq}h8}q~(h>]h?]h=]h<]h@]uhANhBhh-]qhZ)q€}q(h2XThis tutorial covers the **ORIGINAL** release of DynamoDB. It has since been supplanted by a second major version & an updated API to talk to the new version. The documentation for the new version of DynamoDB (& boto's support for it) is at :doc:`DynamoDB v2 `.h3h{h4h5h6h]h8}q‚(h>]h?]h=]h<]h@]uhAKh-]qƒ(hDXThis tutorial covers the q„…q…}q†(h2XThis tutorial covers the h3h€ubcdocutils.nodes strong q‡)qˆ}q‰(h2X **ORIGINAL**h8}qŠ(h>]h?]h=]h<]h@]uh3h€h-]q‹hDXORIGINALqŒ…q}qŽ(h2Uh3hˆubah6UstrongqubhDXÌ release of DynamoDB. It has since been supplanted by a second major version & an updated API to talk to the new version. The documentation for the new version of DynamoDB (& boto's support for it) is at q…q‘}q’(h2XÌ release of DynamoDB. It has since been supplanted by a second major version & an updated API to talk to the new version. The documentation for the new version of DynamoDB (& boto's support for it) is at h3h€ubcsphinx.addnodes pending_xref q“)q”}q•(h2X":doc:`DynamoDB v2 `q–h3h€h4h5h6U pending_xrefq—h8}q˜(UreftypeXdocq™UrefwarnqšˆU reftargetq›X dynamodb2_tutU refdomainUh<]h=]U refexplicitˆh>]h?]h@]UrefdocqœX dynamodb_tutquhAKh-]qžcdocutils.nodes literal qŸ)q }q¡(h2h–h8}q¢(h>]h?]q£(Uxrefq¤h™eh=]h<]h@]uh3h”h-]q¥hDX DynamoDB v2q¦…q§}q¨(h2Uh3h ubah6Uliteralq©ubaubhDX.…qª}q«(h2X.h3h€ubeubaubhH)q¬}q­(h2Uh3hIh4h5h6hKh8}q®(h>]h?]h=]h<]q¯h%ah@]q°h auhAKhBhh-]q±(hP)q²}q³(h2XCreating a Connectionq´h3h¬h4h5h6hTh8}qµ(h>]h?]h=]h<]h@]uhAKhBhh-]q¶hDXCreating a Connectionq·…q¸}q¹(h2h´h3h²ubaubhZ)qº}q»(h2X‰The first step in accessing DynamoDB is to create a connection to the service. To do so, the most straight forward way is the following::h3h¬h4h5h6h]h8}q¼(h>]h?]h=]h<]h@]uhAKhBhh-]q½hDXˆThe first step in accessing DynamoDB is to create a connection to the service. To do so, the most straight forward way is the following:q¾…q¿}qÀ(h2XˆThe first step in accessing DynamoDB is to create a connection to the service. To do so, the most straight forward way is the following:h3hºubaubcdocutils.nodes literal_block qÁ)qÂ}qÃ(h2Xú>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region( 'us-west-2', aws_access_key_id='', aws_secret_access_key='') >>> conn h3h¬h4h5h6U literal_blockqÄh8}qÅ(h:h;h<]h=]h>]h?]h@]uhAKhBhh-]qÆhDXú>>> import boto.dynamodb >>> conn = boto.dynamodb.connect_to_region( 'us-west-2', aws_access_key_id='', aws_secret_access_key='') >>> conn qÇ…qÈ}qÉ(h2Uh3hÂubaubhZ)qÊ}qË(h2X×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. More details on configuration can be found in :doc:`boto_config_tut`.h3h¬h4h5h6h]h8}qÌ(h>]h?]h=]h<]h@]uhAK#hBhh-]qÍ(hDXÀ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. More details on configuration can be found in qÎ…qÏ}qÐ(h2XÀ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. More details on configuration can be found in h3hÊubh“)qÑ}qÒ(h2X:doc:`boto_config_tut`qÓh3hÊh4h5h6h—h8}qÔ(UreftypeXdocqÕhšˆh›Xboto_config_tutU refdomainUh<]h=]U refexplicit‰h>]h?]h@]hœhuhAK#h-]qÖhŸ)q×}qØ(h2hÓh8}qÙ(h>]h?]qÚ(h¤hÕeh=]h<]h@]uh3hÑh-]qÛhDXboto_config_tutqÜ…qÝ}qÞ(h2Uh3h×ubah6h©ubaubhDX.…qß}qà(h2X.h3hÊubeubhZ)qá}qâ(h2XƒThe :py:func:`boto.dynamodb.connect_to_region` function returns a :py:class:`boto.dynamodb.layer2.Layer2` instance, which is a high-level API for working with DynamoDB. Layer2 is a set of abstractions that sit atop the lower level :py:class:`boto.dynamodb.layer1.Layer1` API, which closely mirrors the Amazon DynamoDB API. For the purpose of this tutorial, we'll just be covering Layer2.h3h¬h4h5h6h]h8}qã(h>]h?]h=]h<]h@]uhAK'hBhh-]qä(hDXThe qå…qæ}qç(h2XThe h3háubh“)qè}qé(h2X*:py:func:`boto.dynamodb.connect_to_region`qêh3háh4h5h6h—h8}që(UreftypeXfunchš‰h›Xboto.dynamodb.connect_to_regionU refdomainXpyqìh<]h=]U refexplicit‰h>]h?]h@]hœhUpy:classqíNU py:moduleqîNuhAK'h-]qïhŸ)qð}qñ(h2hêh8}qò(h>]h?]qó(h¤hìXpy-funcqôeh=]h<]h@]uh3hèh-]qõhDX!boto.dynamodb.connect_to_region()qö…q÷}qø(h2Uh3hðubah6h©ubaubhDX function returns a qù…qú}qû(h2X function returns a h3háubh“)qü}qý(h2X':py:class:`boto.dynamodb.layer2.Layer2`qþh3háh4h5h6h—h8}qÿ(UreftypeXclasshš‰h›Xboto.dynamodb.layer2.Layer2U refdomainXpyrh<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAK'h-]rhŸ)r}r(h2hþh8}r(h>]h?]r(h¤jXpy-classreh=]h<]h@]uh3hüh-]rhDXboto.dynamodb.layer2.Layer2r…r }r (h2Uh3jubah6h©ubaubhDX~ instance, which is a high-level API for working with DynamoDB. Layer2 is a set of abstractions that sit atop the lower level r …r }r (h2X~ instance, which is a high-level API for working with DynamoDB. Layer2 is a set of abstractions that sit atop the lower level h3háubh“)r}r(h2X':py:class:`boto.dynamodb.layer1.Layer1`rh3háh4h5h6h—h8}r(UreftypeXclasshš‰h›Xboto.dynamodb.layer1.Layer1U refdomainXpyrh<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAK'h-]rhŸ)r}r(h2jh8}r(h>]h?]r(h¤jXpy-classreh=]h<]h@]uh3jh-]rhDXboto.dynamodb.layer1.Layer1r…r}r(h2Uh3jubah6h©ubaubhDXu API, which closely mirrors the Amazon DynamoDB API. For the purpose of this tutorial, we'll just be covering Layer2.r…r}r(h2Xu API, which closely mirrors the Amazon DynamoDB API. For the purpose of this tutorial, we'll just be covering Layer2.h3háubeubeubhH)r }r!(h2Uh3hIh4h5h6hKh8}r"(h>]h?]h=]h<]r#h,ah@]r$hauhAK0hBhh-]r%(hP)r&}r'(h2XListing Tablesr(h3j h4h5h6hTh8}r)(h>]h?]h=]h<]h@]uhAK0hBhh-]r*hDXListing Tablesr+…r,}r-(h2j(h3j&ubaubhZ)r.}r/(h2XoNow that we have a DynamoDB connection object, we can then query for a list of existing tables in that region::h3j h4h5h6h]h8}r0(h>]h?]h=]h<]h@]uhAK2hBhh-]r1hDXnNow that we have a DynamoDB connection object, we can then query for a list of existing tables in that region:r2…r3}r4(h2XnNow that we have a DynamoDB connection object, we can then query for a list of existing tables in that region:h3j.ubaubhÁ)r5}r6(h2X6>>> conn.list_tables() ['test-table', 'another-table']h3j h4h5h6hÄh8}r7(h:h;h<]h=]h>]h?]h@]uhAK5hBhh-]r8hDX6>>> conn.list_tables() ['test-table', 'another-table']r9…r:}r;(h2Uh3j5ubaubeubhH)r<}r=(h2Uh3hIh4h5h6hKh8}r>(h>]h?]h=]h<]r?h)ah@]r@hauhAK:hBhh-]rA(hP)rB}rC(h2XCreating TablesrDh3j<h4h5h6hTh8}rE(h>]h?]h=]h<]h@]uhAK:hBhh-]rFhDXCreating TablesrG…rH}rI(h2jDh3jBubaubhZ)rJ}rK(h2XŠDynamoDB tables are created with the :py:meth:`Layer2.create_table ` method. While DynamoDB's items (a rough equivalent to a relational DB's row) don't have a fixed schema, you do need to create a schema for the table's hash key element, and the optional range key element. This is explained in greater detail in DynamoDB's `Data Model`_ documentation.h3j<h4h5h6h]h8}rL(h>]h?]h=]h<]h@]uhAK`rSh3jJh4h5h6h—h8}rT(UreftypeXmethhš‰h›X(boto.dynamodb.layer2.Layer2.create_tableU refdomainXpyrUh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAK]h?]rZ(h¤jUXpy-methr[eh=]h<]h@]uh3jQh-]r\hDXLayer2.create_tabler]…r^}r_(h2Uh3jWubah6h©ubaubhDX method. While DynamoDB's items (a rough equivalent to a relational DB's row) don't have a fixed schema, you do need to create a schema for the table's hash key element, and the optional range key element. This is explained in greater detail in DynamoDB's r`…ra}rb(h2X method. While DynamoDB's items (a rough equivalent to a relational DB's row) don't have a fixed schema, you do need to create a schema for the table's hash key element, and the optional range key element. This is explained in greater detail in DynamoDB's h3jJubhc)rc}rd(h2X `Data Model`_hfKh3jJh6hgh8}re(UnameX Data ModelhiXUhttp://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/DataModel.htmlrfh<]h=]h>]h?]h@]uh-]rghDX Data Modelrh…ri}rj(h2Uh3jcubaubhDX documentation.rk…rl}rm(h2X documentation.h3jJubeubhZ)rn}ro(h2X\We'll start by defining a schema that has a hash key and a range key that are both strings::h3j<h4h5h6h]h8}rp(h>]h?]h=]h<]h@]uhAKChBhh-]rqhDX[We'll start by defining a schema that has a hash key and a range key that are both strings:rr…rs}rt(h2X[We'll start by defining a schema that has a hash key and a range key that are both strings:h3jnubaubhÁ)ru}rv(h2X¾>>> message_table_schema = conn.create_schema( hash_key_name='forum_name', hash_key_proto_value=str, range_key_name='subject', range_key_proto_value=str )h3j<h4h5h6hÄh8}rw(h:h;h<]h=]h>]h?]h@]uhAKFhBhh-]rxhDX¾>>> message_table_schema = conn.create_schema( hash_key_name='forum_name', hash_key_proto_value=str, range_key_name='subject', range_key_proto_value=str )ry…rz}r{(h2Uh3juubaubhZ)r|}r}(h2XžThe next few things to determine are table name and read/write throughput. We'll defer explaining throughput to the DynamoDB's `Provisioned Throughput`_ docs.h3j<h4h5h6h]h8}r~(h>]h?]h=]h<]h@]uhAKMhBhh-]r(hDXThe next few things to determine are table name and read/write throughput. We'll defer explaining throughput to the DynamoDB's r€…r}r‚(h2XThe next few things to determine are table name and read/write throughput. We'll defer explaining throughput to the DynamoDB's h3j|ubhc)rƒ}r„(h2X`Provisioned Throughput`_hfKh3j|h6hgh8}r…(UnameXProvisioned ThroughputhiXfhttp://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.htmlr†h<]h=]h>]h?]h@]uh-]r‡hDXProvisioned Throughputrˆ…r‰}rŠ(h2Uh3jƒubaubhDX docs.r‹…rŒ}r(h2X docs.h3j|ubeubhZ)rŽ}r(h2X%We're now ready to create the table::rh3j<h4h5h6h]h8}r‘(h>]h?]h=]h<]h@]uhAKPhBhh-]r’hDX$We're now ready to create the table:r“…r”}r•(h2X$We're now ready to create the table:h3jŽubaubhÁ)r–}r—(h2Xª>>> table = conn.create_table( name='messages', schema=message_table_schema, read_units=10, write_units=10 ) >>> table Table(messages)h3j<h4h5h6hÄh8}r˜(h:h;h<]h=]h>]h?]h@]uhAKRhBhh-]r™hDXª>>> table = conn.create_table( name='messages', schema=message_table_schema, read_units=10, write_units=10 ) >>> table Table(messages)rš…r›}rœ(h2Uh3j–ubaubhZ)r}rž(h2X„This returns a :py:class:`boto.dynamodb.table.Table` instance, which provides simple ways to create (put), update, and delete items.h3j<h4h5h6h]h8}rŸ(h>]h?]h=]h<]h@]uhAK[hBhh-]r (hDXThis returns a r¡…r¢}r£(h2XThis returns a h3jubh“)r¤}r¥(h2X%:py:class:`boto.dynamodb.table.Table`r¦h3jh4h5h6h—h8}r§(UreftypeXclasshš‰h›Xboto.dynamodb.table.TableU refdomainXpyr¨h<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAK[h-]r©hŸ)rª}r«(h2j¦h8}r¬(h>]h?]r­(h¤j¨Xpy-classr®eh=]h<]h@]uh3j¤h-]r¯hDXboto.dynamodb.table.Tabler°…r±}r²(h2Uh3jªubah6h©ubaubhDXP instance, which provides simple ways to create (put), update, and delete items.r³…r´}rµ(h2XP instance, which provides simple ways to create (put), update, and delete items.h3jubeubeubhH)r¶}r·(h2Uh3hIh4h5h6hKh8}r¸(h>]h?]h=]h<]r¹h'ah@]rºhauhAK`hBhh-]r»(hP)r¼}r½(h2XGetting a Tabler¾h3j¶h4h5h6hTh8}r¿(h>]h?]h=]h<]h@]uhAK`hBhh-]rÀhDXGetting a TablerÁ…rÂ}rÃ(h2j¾h3j¼ubaubhZ)rÄ}rÅ(h2XhTo retrieve an existing table, use :py:meth:`Layer2.get_table `::h3j¶h4h5h6h]h8}rÆ(h>]h?]h=]h<]h@]uhAKbhBhh-]rÇ(hDX#To retrieve an existing table, use rÈ…rÉ}rÊ(h2X#To retrieve an existing table, use h3jÄubh“)rË}rÌ(h2XC:py:meth:`Layer2.get_table `rÍh3jÄh4h5h6h—h8}rÎ(UreftypeXmethhš‰h›X%boto.dynamodb.layer2.Layer2.get_tableU refdomainXpyrÏh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKbh-]rÐhŸ)rÑ}rÒ(h2jÍh8}rÓ(h>]h?]rÔ(h¤jÏXpy-methrÕeh=]h<]h@]uh3jËh-]rÖhDXLayer2.get_tabler×…rØ}rÙ(h2Uh3jÑubah6h©ubaubhDX:…rÚ}rÛ(h2X:h3jÄubeubhÁ)rÜ}rÝ(h2Xƒ>>> conn.list_tables() ['test-table', 'another-table', 'messages'] >>> table = conn.get_table('messages') >>> table Table(messages)h3j¶h4h5h6hÄh8}rÞ(h:h;h<]h=]h>]h?]h@]uhAKehBhh-]rßhDXƒ>>> conn.list_tables() ['test-table', 'another-table', 'messages'] >>> table = conn.get_table('messages') >>> table Table(messages)rà…rá}râ(h2Uh3jÜubaubhZ)rã}rä(h2XÎ:py:meth:`Layer2.get_table `, like :py:meth:`Layer2.create_table `, returns a :py:class:`boto.dynamodb.table.Table` instance.h3j¶h4h5h6h]h8}rå(h>]h?]h=]h<]h@]uhAKkhBhh-]ræ(h“)rç}rè(h2XC:py:meth:`Layer2.get_table `réh3jãh4h5h6h—h8}rê(UreftypeXmethhš‰h›X%boto.dynamodb.layer2.Layer2.get_tableU refdomainXpyrëh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKkh-]rìhŸ)rí}rî(h2jéh8}rï(h>]h?]rð(h¤jëXpy-methrñeh=]h<]h@]uh3jçh-]ròhDXLayer2.get_tableró…rô}rõ(h2Uh3jíubah6h©ubaubhDX, like rö…r÷}rø(h2X, like h3jãubh“)rù}rú(h2XI:py:meth:`Layer2.create_table `rûh3jãh4h5h6h—h8}rü(UreftypeXmethhš‰h›X(boto.dynamodb.layer2.Layer2.create_tableU refdomainXpyrýh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKkh-]rþhŸ)rÿ}r(h2jûh8}r(h>]h?]r(h¤jýXpy-methreh=]h<]h@]uh3jùh-]rhDXLayer2.create_tabler…r}r(h2Uh3jÿubah6h©ubaubhDX , returns a r…r }r (h2X , returns a h3jãubh“)r }r (h2X%:py:class:`boto.dynamodb.table.Table`r h3jãh4h5h6h—h8}r(UreftypeXclasshš‰h›Xboto.dynamodb.table.TableU refdomainXpyrh<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAKkh-]rhŸ)r}r(h2j h8}r(h>]h?]r(h¤jXpy-classreh=]h<]h@]uh3j h-]rhDXboto.dynamodb.table.Tabler…r}r(h2Uh3jubah6h©ubaubhDX instance.r…r}r(h2X instance.h3jãubeubhZ)r}r(h2X‰Keep in mind that :py:meth:`Layer2.get_table ` will make an API call to retrieve various attributes of the table including the creation time, the read and write capacity, and the table schema. If you already know the schema, you can save an API call and create a :py:class:`boto.dynamodb.table.Table` object without making any calls to Amazon DynamoDB::h3j¶h4h5h6h]h8}r(h>]h?]h=]h<]h@]uhAKohBhh-]r (hDXKeep in mind that r!…r"}r#(h2XKeep in mind that h3jubh“)r$}r%(h2XC:py:meth:`Layer2.get_table `r&h3jh4h5h6h—h8}r'(UreftypeXmethhš‰h›X%boto.dynamodb.layer2.Layer2.get_tableU refdomainXpyr(h<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKoh-]r)hŸ)r*}r+(h2j&h8}r,(h>]h?]r-(h¤j(Xpy-methr.eh=]h<]h@]uh3j$h-]r/hDXLayer2.get_tabler0…r1}r2(h2Uh3j*ubah6h©ubaubhDXÚ will make an API call to retrieve various attributes of the table including the creation time, the read and write capacity, and the table schema. If you already know the schema, you can save an API call and create a r3…r4}r5(h2XÚ will make an API call to retrieve various attributes of the table including the creation time, the read and write capacity, and the table schema. If you already know the schema, you can save an API call and create a h3jubh“)r6}r7(h2X%:py:class:`boto.dynamodb.table.Table`r8h3jh4h5h6h—h8}r9(UreftypeXclasshš‰h›Xboto.dynamodb.table.TableU refdomainXpyr:h<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAKoh-]r;hŸ)r<}r=(h2j8h8}r>(h>]h?]r?(h¤j:Xpy-classr@eh=]h<]h@]uh3j6h-]rAhDXboto.dynamodb.table.TablerB…rC}rD(h2Uh3j<ubah6h©ubaubhDX4 object without making any calls to Amazon DynamoDB:rE…rF}rG(h2X4 object without making any calls to Amazon DynamoDB:h3jubeubhÁ)rH}rI(h2XY>>> table = conn.table_from_schema( name='messages', schema=message_table_schema)h3j¶h4h5h6hÄh8}rJ(h:h;h<]h=]h>]h?]h@]uhAKvhBhh-]rKhDXY>>> table = conn.table_from_schema( name='messages', schema=message_table_schema)rL…rM}rN(h2Uh3jHubaubhZ)rO}rP(h2X?If you do this, the following fields will have ``None`` values:rQh3j¶h4h5h6h]h8}rR(h>]h?]h=]h<]h@]uhAKzhBhh-]rS(hDX/If you do this, the following fields will have rT…rU}rV(h2X/If you do this, the following fields will have h3jOubhŸ)rW}rX(h2X``None``h8}rY(h>]h?]h=]h<]h@]uh3jOh-]rZhDXNoner[…r\}r](h2Uh3jWubah6h©ubhDX values:r^…r_}r`(h2X values:h3jOubeubcdocutils.nodes block_quote ra)rb}rc(h2Uh3j¶h4Nh6U block_quoterdh8}re(h>]h?]h=]h<]h@]uhANhBhh-]rfcdocutils.nodes bullet_list rg)rh}ri(h2Uh8}rj(UbulletrkX*h<]h=]h>]h?]h@]uh3jbh-]rl(cdocutils.nodes list_item rm)rn}ro(h2X create_timerph8}rq(h>]h?]h=]h<]h@]uh3jhh-]rrhZ)rs}rt(h2jph3jnh4h5h6h]h8}ru(h>]h?]h=]h<]h@]uhAK|h-]rvhDX create_timerw…rx}ry(h2jph3jsubaubah6U list_itemrzubjm)r{}r|(h2Xstatusr}h8}r~(h>]h?]h=]h<]h@]uh3jhh-]rhZ)r€}r(h2j}h3j{h4h5h6h]h8}r‚(h>]h?]h=]h<]h@]uhAK}h-]rƒhDXstatusr„…r…}r†(h2j}h3j€ubaubah6jzubjm)r‡}rˆ(h2X read_unitsr‰h8}rŠ(h>]h?]h=]h<]h@]uh3jhh-]r‹hZ)rŒ}r(h2j‰h3j‡h4h5h6h]h8}rŽ(h>]h?]h=]h<]h@]uhAK~h-]rhDX read_unitsr…r‘}r’(h2j‰h3jŒubaubah6jzubjm)r“}r”(h2X write_units h8}r•(h>]h?]h=]h<]h@]uh3jhh-]r–hZ)r—}r˜(h2X write_unitsr™h3j“h4h5h6h]h8}rš(h>]h?]h=]h<]h@]uhAKh-]r›hDX write_unitsrœ…r}rž(h2j™h3j—ubaubah6jzubeh6U bullet_listrŸubaubhZ)r }r¡(h2XIn addition, the ``item_count`` and ``size_bytes`` will be 0. If you create a table object directly from a schema object and decide later that you need to retrieve any of these additional attributes, you can use the :py:meth:`Table.refresh ` method::h3j¶h4h5h6h]h8}r¢(h>]h?]h=]h<]h@]uhAKhBhh-]r£(hDXIn addition, the r¤…r¥}r¦(h2XIn addition, the h3j ubhŸ)r§}r¨(h2X``item_count``h8}r©(h>]h?]h=]h<]h@]uh3j h-]rªhDX item_countr«…r¬}r­(h2Uh3j§ubah6h©ubhDX and r®…r¯}r°(h2X and h3j ubhŸ)r±}r²(h2X``size_bytes``h8}r³(h>]h?]h=]h<]h@]uh3j h-]r´hDX size_bytesrµ…r¶}r·(h2Uh3j±ubah6h©ubhDX¦ will be 0. If you create a table object directly from a schema object and decide later that you need to retrieve any of these additional attributes, you can use the r¸…r¹}rº(h2X¦ will be 0. If you create a table object directly from a schema object and decide later that you need to retrieve any of these additional attributes, you can use the h3j ubh“)r»}r¼(h2X<:py:meth:`Table.refresh `r½h3j h4h5h6h—h8}r¾(UreftypeXmethhš‰h›X!boto.dynamodb.table.Table.refreshU refdomainXpyr¿h<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKh-]rÀhŸ)rÁ}rÂ(h2j½h8}rÃ(h>]h?]rÄ(h¤j¿Xpy-methrÅeh=]h<]h@]uh3j»h-]rÆhDX Table.refreshrÇ…rÈ}rÉ(h2Uh3jÁubah6h©ubaubhDX method:rÊ…rË}rÌ(h2X method:h3j ubeubhÁ)rÍ}rÎ(h2Xf>>> from boto.dynamodb.schema import Schema >>> table = conn.table_from_schema( name='messages', schema=Schema.create(hash_key=('forum_name', 'S'), range_key=('subject', 'S'))) >>> print table.write_units None >>> # Now we decide we need to know the write_units: >>> table.refresh() >>> print table.write_units 10h3j¶h4h5h6hÄh8}rÏ(h:h;h<]h=]h>]h?]h@]uhAK‡hBhh-]rÐhDXf>>> from boto.dynamodb.schema import Schema >>> table = conn.table_from_schema( name='messages', schema=Schema.create(hash_key=('forum_name', 'S'), range_key=('subject', 'S'))) >>> print table.write_units None >>> # Now we decide we need to know the write_units: >>> table.refresh() >>> print table.write_units 10rÑ…rÒ}rÓ(h2Uh3jÍubaubhZ)rÔ}rÕ(h2XThe recommended best practice is to retrieve a table object once and use that object for the duration of your application. So, for example, instead of this::h3j¶h4h5h6h]h8}rÖ(h>]h?]h=]h<]h@]uhAK”hBhh-]r×hDXœThe recommended best practice is to retrieve a table object once and use that object for the duration of your application. So, for example, instead of this:rØ…rÙ}rÚ(h2XœThe recommended best practice is to retrieve a table object once and use that object for the duration of your application. So, for example, instead of this:h3jÔubaubhÁ)rÛ}rÜ(h2XÇclass Application(object): def __init__(self, layer2): self._layer2 = layer2 def retrieve_item(self, table_name, key): return self._layer2.get_table(table_name).get_item(key)h3j¶h4h5h6hÄh8}rÝ(h:h;h<]h=]h>]h?]h@]uhAK˜hBhh-]rÞhDXÇclass Application(object): def __init__(self, layer2): self._layer2 = layer2 def retrieve_item(self, table_name, key): return self._layer2.get_table(table_name).get_item(key)rß…rà}rá(h2Uh3jÛubaubhZ)râ}rã(h2X(You can do something like this instead::räh3j¶h4h5h6h]h8}rå(h>]h?]h=]h<]h@]uhAKŸhBhh-]ræhDX'You can do something like this instead:rç…rè}ré(h2X'You can do something like this instead:h3jâubaubhÁ)rê}rë(h2X‡class Application(object): def __init__(self, layer2): self._layer2 = layer2 self._tables_by_name = {} def retrieve_item(self, table_name, key): table = self._tables_by_name.get(table_name) if table is None: table = self._layer2.get_table(table_name) self._tables_by_name[table_name] = table return table.get_item(key)h3j¶h4h5h6hÄh8}rì(h:h;h<]h=]h>]h?]h@]uhAK¡hBhh-]ríhDX‡class Application(object): def __init__(self, layer2): self._layer2 = layer2 self._tables_by_name = {} def retrieve_item(self, table_name, key): table = self._tables_by_name.get(table_name) if table is None: table = self._layer2.get_table(table_name) self._tables_by_name[table_name] = table return table.get_item(key)rî…rï}rð(h2Uh3jêubaubeubhH)rñ}rò(h2Uh3hIh4h5h6hKh8}ró(h>]h?]h=]h<]rôhah@]rõhauhAK¯hBhh-]rö(hP)r÷}rø(h2XDescribing Tablesrùh3jñh4h5h6hTh8}rú(h>]h?]h=]h<]h@]uhAK¯hBhh-]rûhDXDescribing Tablesrü…rý}rþ(h2jùh3j÷ubaubhZ)rÿ}r(h2X}To get a complete description of a table, use :py:meth:`Layer2.describe_table `::h3jñh4h5h6h]h8}r(h>]h?]h=]h<]h@]uhAK±hBhh-]r(hDX.To get a complete description of a table, use r…r}r(h2X.To get a complete description of a table, use h3jÿubh“)r}r(h2XM:py:meth:`Layer2.describe_table `rh3jÿh4h5h6h—h8}r (UreftypeXmethhš‰h›X*boto.dynamodb.layer2.Layer2.describe_tableU refdomainXpyr h<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAK±h-]r hŸ)r }r (h2jh8}r(h>]h?]r(h¤j Xpy-methreh=]h<]h@]uh3jh-]rhDXLayer2.describe_tabler…r}r(h2Uh3j ubah6h©ubaubhDX:…r}r(h2X:h3jÿubeubhÁ)r}r(h2X¾>>> conn.list_tables() ['test-table', 'another-table', 'messages'] >>> conn.describe_table('messages') { 'Table': { 'CreationDateTime': 1327117581.624, 'ItemCount': 0, 'KeySchema': { 'HashKeyElement': { 'AttributeName': 'forum_name', 'AttributeType': 'S' }, 'RangeKeyElement': { 'AttributeName': 'subject', 'AttributeType': 'S' } }, 'ProvisionedThroughput': { 'ReadCapacityUnits': 10, 'WriteCapacityUnits': 10 }, 'TableName': 'messages', 'TableSizeBytes': 0, 'TableStatus': 'ACTIVE' } }h3jñh4h5h6hÄh8}r(h:h;h<]h=]h>]h?]h@]uhAK´hBhh-]rhDX¾>>> conn.list_tables() ['test-table', 'another-table', 'messages'] >>> conn.describe_table('messages') { 'Table': { 'CreationDateTime': 1327117581.624, 'ItemCount': 0, 'KeySchema': { 'HashKeyElement': { 'AttributeName': 'forum_name', 'AttributeType': 'S' }, 'RangeKeyElement': { 'AttributeName': 'subject', 'AttributeType': 'S' } }, 'ProvisionedThroughput': { 'ReadCapacityUnits': 10, 'WriteCapacityUnits': 10 }, 'TableName': 'messages', 'TableSizeBytes': 0, 'TableStatus': 'ACTIVE' } }r…r}r(h2Uh3jubaubeubhH)r}r(h2Uh3hIh4h5h6hKh8}r (h>]h?]h=]h<]r!h+ah@]r"hauhAKÑhBhh-]r#(hP)r$}r%(h2X Adding Itemsr&h3jh4h5h6hTh8}r'(h>]h?]h=]h<]h@]uhAKÑhBhh-]r(hDX Adding Itemsr)…r*}r+(h2j&h3j$ubaubhZ)r,}r-(h2XIContinuing on with our previously created ``messages`` table, adding an::r.h3jh4h5h6h]h8}r/(h>]h?]h=]h<]h@]uhAKÓhBhh-]r0(hDX*Continuing on with our previously created r1…r2}r3(h2X*Continuing on with our previously created h3j,ubhŸ)r4}r5(h2X ``messages``h8}r6(h>]h?]h=]h<]h@]uh3j,h-]r7hDXmessagesr8…r9}r:(h2Uh3j4ubah6h©ubhDX table, adding an:r;…r<}r=(h2X table, adding an:h3j,ubeubhÁ)r>}r?(h2X”>>> table = conn.get_table('messages') >>> item_data = { 'Body': 'http://url_to_lolcat.gif', 'SentBy': 'User A', 'ReceivedTime': '12/9/2011 11:36:03 PM', } >>> item = table.new_item( # Our hash key is 'forum' hash_key='LOLCat Forum', # Our range key is 'subject' range_key='Check this out!', # This has the attrs=item_data )h3jh4h5h6hÄh8}r@(h:h;h<]h=]h>]h?]h@]uhAKÕhBhh-]rAhDX”>>> table = conn.get_table('messages') >>> item_data = { 'Body': 'http://url_to_lolcat.gif', 'SentBy': 'User A', 'ReceivedTime': '12/9/2011 11:36:03 PM', } >>> item = table.new_item( # Our hash key is 'forum' hash_key='LOLCat Forum', # Our range key is 'subject' range_key='Check this out!', # This has the attrs=item_data )rB…rC}rD(h2Uh3j>ubaubhZ)rE}rF(h2X>The :py:meth:`Table.new_item ` method creates a new :py:class:`boto.dynamodb.item.Item` instance with your specified hash key, range key, and attributes already set. :py:class:`Item ` is a :py:class:`dict` sub-class, meaning you can edit your data as such::h3jh4h5h6h]h8}rG(h>]h?]h=]h<]h@]uhAKähBhh-]rH(hDXThe rI…rJ}rK(h2XThe h3jEubh“)rL}rM(h2X>:py:meth:`Table.new_item `rNh3jEh4h5h6h—h8}rO(UreftypeXmethhš‰h›X"boto.dynamodb.table.Table.new_itemU refdomainXpyrPh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKäh-]rQhŸ)rR}rS(h2jNh8}rT(h>]h?]rU(h¤jPXpy-methrVeh=]h<]h@]uh3jLh-]rWhDXTable.new_itemrX…rY}rZ(h2Uh3jRubah6h©ubaubhDX method creates a new r[…r\}r](h2X method creates a new h3jEubh“)r^}r_(h2X#:py:class:`boto.dynamodb.item.Item`r`h3jEh4h5h6h—h8}ra(UreftypeXclasshš‰h›Xboto.dynamodb.item.ItemU refdomainXpyrbh<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAKäh-]rchŸ)rd}re(h2j`h8}rf(h>]h?]rg(h¤jbXpy-classrheh=]h<]h@]uh3j^h-]rihDXboto.dynamodb.item.Itemrj…rk}rl(h2Uh3jdubah6h©ubaubhDXO instance with your specified hash key, range key, and attributes already set. rm…rn}ro(h2XO instance with your specified hash key, range key, and attributes already set. h3jEubh“)rp}rq(h2X*:py:class:`Item `rrh3jEh4h5h6h—h8}rs(UreftypeXclasshš‰h›Xboto.dynamodb.item.ItemU refdomainXpyrth<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKäh-]ruhŸ)rv}rw(h2jrh8}rx(h>]h?]ry(h¤jtXpy-classrzeh=]h<]h@]uh3jph-]r{hDXItemr|…r}}r~(h2Uh3jvubah6h©ubaubhDX is a r…r€}r(h2X is a h3jEubh“)r‚}rƒ(h2X:py:class:`dict`r„h3jEh4h5h6h—h8}r…(UreftypeXclasshš‰h›XdictU refdomainXpyr†h<]h=]U refexplicit‰h>]h?]h@]hœhhíNhîNuhAKäh-]r‡hŸ)rˆ}r‰(h2j„h8}rŠ(h>]h?]r‹(h¤j†Xpy-classrŒeh=]h<]h@]uh3j‚h-]rhDXdictrŽ…r}r(h2Uh3jˆubah6h©ubaubhDX3 sub-class, meaning you can edit your data as such:r‘…r’}r“(h2X3 sub-class, meaning you can edit your data as such:h3jEubeubhÁ)r”}r•(h2X3item['a_new_key'] = 'testing' del item['a_new_key']h3jh4h5h6hÄh8}r–(h:h;h<]h=]h>]h?]h@]uhAKëhBhh-]r—hDX3item['a_new_key'] = 'testing' del item['a_new_key']r˜…r™}rš(h2Uh3j”ubaubhZ)r›}rœ(h2XƒAfter you are happy with the contents of the item, use :py:meth:`Item.put ` to commit it to DynamoDB::h3jh4h5h6h]h8}r(h>]h?]h=]h<]h@]uhAKîhBhh-]rž(hDX7After you are happy with the contents of the item, use rŸ…r }r¡(h2X7After you are happy with the contents of the item, use h3j›ubh“)r¢}r£(h2X1:py:meth:`Item.put `r¤h3j›h4h5h6h—h8}r¥(UreftypeXmethhš‰h›Xboto.dynamodb.item.Item.putU refdomainXpyr¦h<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAKîh-]r§hŸ)r¨}r©(h2j¤h8}rª(h>]h?]r«(h¤j¦Xpy-methr¬eh=]h<]h@]uh3j¢h-]r­hDXItem.putr®…r¯}r°(h2Uh3j¨ubah6h©ubaubhDX to commit it to DynamoDB:r±…r²}r³(h2X to commit it to DynamoDB:h3j›ubeubhÁ)r´}rµ(h2X>>> item.put()h3jh4h5h6hÄh8}r¶(h:h;h<]h=]h>]h?]h@]uhAKñhBhh-]r·hDX>>> item.put()r¸…r¹}rº(h2Uh3j´ubaubeubhH)r»}r¼(h2Uh3hIh4h5h6hKh8}r½(h>]h?]h=]h<]r¾h!ah@]r¿h auhAKõhBhh-]rÀ(hP)rÁ}rÂ(h2XRetrieving ItemsrÃh3j»h4h5h6hTh8}rÄ(h>]h?]h=]h<]h@]uhAKõhBhh-]rÅhDXRetrieving ItemsrÆ…rÇ}rÈ(h2jÃh3jÁubaubhZ)rÉ}rÊ(h2X¦Now, let's check if it got added correctly. Since DynamoDB works under an 'eventual consistency' mode, we need to specify that we wish a consistent read, as follows::h3j»h4h5h6h]h8}rË(h>]h?]h=]h<]h@]uhAK÷hBhh-]rÌhDX¥Now, let's check if it got added correctly. Since DynamoDB works under an 'eventual consistency' mode, we need to specify that we wish a consistent read, as follows:rÍ…rÎ}rÏ(h2X¥Now, let's check if it got added correctly. Since DynamoDB works under an 'eventual consistency' mode, we need to specify that we wish a consistent read, as follows:h3jÉubaubhÁ)rÐ}rÑ(h2X>>> table = conn.get_table('messages') >>> item = table.get_item( # Your hash key was 'forum_name' hash_key='LOLCat Forum', # Your range key was 'subject' range_key='Check this out!' ) >>> item { # Note that this was your hash key attribute (forum_name) 'forum_name': 'LOLCat Forum', # This is your range key attribute (subject) 'subject': 'Check this out!' 'Body': 'http://url_to_lolcat.gif', 'ReceivedTime': '12/9/2011 11:36:03 PM', 'SentBy': 'User A', }h3j»h4h5h6hÄh8}rÒ(h:h;h<]h=]h>]h?]h@]uhAKûhBhh-]rÓhDX>>> table = conn.get_table('messages') >>> item = table.get_item( # Your hash key was 'forum_name' hash_key='LOLCat Forum', # Your range key was 'subject' range_key='Check this out!' ) >>> item { # Note that this was your hash key attribute (forum_name) 'forum_name': 'LOLCat Forum', # This is your range key attribute (subject) 'subject': 'Check this out!' 'Body': 'http://url_to_lolcat.gif', 'ReceivedTime': '12/9/2011 11:36:03 PM', 'SentBy': 'User A', }rÔ…rÕ}rÖ(h2Uh3jÐubaubeubhH)r×}rØ(h2Uh3hIh4h5h6hKh8}rÙ(h>]h?]h=]h<]rÚh$ah@]rÛh auhAMhBhh-]rÜ(hP)rÝ}rÞ(h2XUpdating Itemsrßh3j×h4h5h6hTh8}rà(h>]h?]h=]h<]h@]uhAMhBhh-]ráhDXUpdating Itemsrâ…rã}rä(h2jßh3jÝubaubhZ)rå}ræ(h2X‡To update an item's attributes, simply retrieve it, modify the value, then :py:meth:`Item.put ` it again::h3j×h4h5h6h]h8}rç(h>]h?]h=]h<]h@]uhAMhBhh-]rè(hDXKTo update an item's attributes, simply retrieve it, modify the value, then ré…rê}rë(h2XKTo update an item's attributes, simply retrieve it, modify the value, then h3jåubh“)rì}rí(h2X1:py:meth:`Item.put `rîh3jåh4h5h6h—h8}rï(UreftypeXmethhš‰h›Xboto.dynamodb.item.Item.putU refdomainXpyrðh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAMh-]rñhŸ)rò}ró(h2jîh8}rô(h>]h?]rõ(h¤jðXpy-methröeh=]h<]h@]uh3jìh-]r÷hDXItem.putrø…rù}rú(h2Uh3jòubah6h©ubaubhDX it again:rû…rü}rý(h2X it again:h3jåubeubhÁ)rþ}rÿ(h2X¹>>> table = conn.get_table('messages') >>> item = table.get_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item['SentBy'] = 'User B' >>> item.put()h3j×h4h5h6hÄh8}r(h:h;h<]h=]h>]h?]h@]uhAMhBhh-]rhDX¹>>> table = conn.get_table('messages') >>> item = table.get_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item['SentBy'] = 'User B' >>> item.put()r…r}r(h2Uh3jþubaubeubhH)r}r(h2Uh3hIh4h5h6hKh8}r(h>]h?]h=]h<]rhah@]r hauhAMhBhh-]r (hP)r }r (h2XWorking with Decimalsr h3jh4h5h6hTh8}r(h>]h?]h=]h<]h@]uhAMhBhh-]rhDXWorking with Decimalsr…r}r(h2j h3j ubaubhZ)r}r(h2XpTo avoid the loss of precision, you can stipulate that the ``decimal.Decimal`` type be used for numeric values::h3jh4h5h6h]h8}r(h>]h?]h=]h<]h@]uhAMhBhh-]r(hDX;To avoid the loss of precision, you can stipulate that the r…r}r(h2X;To avoid the loss of precision, you can stipulate that the h3jubhŸ)r}r(h2X``decimal.Decimal``h8}r(h>]h?]h=]h<]h@]uh3jh-]rhDXdecimal.Decimalr…r}r (h2Uh3jubah6h©ubhDX! type be used for numeric values:r!…r"}r#(h2X! type be used for numeric values:h3jubeubhÁ)r$}r%(h2X¯>>> import decimal >>> conn.use_decimals() >>> table = conn.get_table('messages') >>> item = table.new_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item['decimal_type'] = decimal.Decimal('1.12345678912345') >>> item.put() >>> print table.get_item('LOLCat Forum', 'Check this out!') {u'forum_name': 'LOLCat Forum', u'decimal_type': Decimal('1.12345678912345'), u'subject': 'Check this out!'}h3jh4h5h6hÄh8}r&(h:h;h<]h=]h>]h?]h@]uhAM"hBhh-]r'hDX¯>>> import decimal >>> conn.use_decimals() >>> table = conn.get_table('messages') >>> item = table.new_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item['decimal_type'] = decimal.Decimal('1.12345678912345') >>> item.put() >>> print table.get_item('LOLCat Forum', 'Check this out!') {u'forum_name': 'LOLCat Forum', u'decimal_type': Decimal('1.12345678912345'), u'subject': 'Check this out!'}r(…r)}r*(h2Uh3j$ubaubhZ)r+}r,(h2XËYou can enable the usage of ``decimal.Decimal`` by using either the ``use_decimals`` method, or by passing in the :py:class:`Dynamizer ` class for the ``dynamizer`` param::h3jh4h5h6h]h8}r-(h>]h?]h=]h<]h@]uhAM/hBhh-]r.(hDXYou can enable the usage of r/…r0}r1(h2XYou can enable the usage of h3j+ubhŸ)r2}r3(h2X``decimal.Decimal``h8}r4(h>]h?]h=]h<]h@]uh3j+h-]r5hDXdecimal.Decimalr6…r7}r8(h2Uh3j2ubah6h©ubhDX by using either the r9…r:}r;(h2X by using either the h3j+ubhŸ)r<}r=(h2X``use_decimals``h8}r>(h>]h?]h=]h<]h@]uh3j+h-]r?hDX use_decimalsr@…rA}rB(h2Uh3j<ubah6h©ubhDX method, or by passing in the rC…rD}rE(h2X method, or by passing in the h3j+ubh“)rF}rG(h2X5:py:class:`Dynamizer `rHh3j+h4h5h6h—h8}rI(UreftypeXclasshš‰h›Xboto.dynamodb.types.DynamizerU refdomainXpyrJh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAM/h-]rKhŸ)rL}rM(h2jHh8}rN(h>]h?]rO(h¤jJXpy-classrPeh=]h<]h@]uh3jFh-]rQhDX DynamizerrR…rS}rT(h2Uh3jLubah6h©ubaubhDX class for the rU…rV}rW(h2X class for the h3j+ubhŸ)rX}rY(h2X ``dynamizer``h8}rZ(h>]h?]h=]h<]h@]uh3j+h-]r[hDX dynamizerr\…r]}r^(h2Uh3jXubah6h©ubhDX param:r_…r`}ra(h2X param:h3j+ubeubhÁ)rb}rc(h2Xm>>> from boto.dynamodb.types import Dynamizer >>> conn = boto.dynamodb.connect_to_region(dynamizer=Dynamizer)h3jh4h5h6hÄh8}rd(h:h;h<]h=]h>]h?]h@]uhAM4hBhh-]rehDXm>>> from boto.dynamodb.types import Dynamizer >>> conn = boto.dynamodb.connect_to_region(dynamizer=Dynamizer)rf…rg}rh(h2Uh3jbubaubhZ)ri}rj(h2XiThis mechanism can also be used if you want to customize the encoding/decoding process of DynamoDB types.rkh3jh4h5h6h]h8}rl(h>]h?]h=]h<]h@]uhAM7hBhh-]rmhDXiThis mechanism can also be used if you want to customize the encoding/decoding process of DynamoDB types.rn…ro}rp(h2jkh3jiubaubeubhH)rq}rr(h2Uh3hIh4h5h6hKh8}rs(h>]h?]h=]h<]rth"ah@]ruh auhAM<hBhh-]rv(hP)rw}rx(h2XDeleting Itemsryh3jqh4h5h6hTh8}rz(h>]h?]h=]h<]h@]uhAM<hBhh-]r{hDXDeleting Itemsr|…r}}r~(h2jyh3jwubaubhZ)r}r€(h2XYTo delete items, use the :py:meth:`Item.delete ` method::h3jqh4h5h6h]h8}r(h>]h?]h=]h<]h@]uhAM>hBhh-]r‚(hDXTo delete items, use the rƒ…r„}r…(h2XTo delete items, use the h3jubh“)r†}r‡(h2X7:py:meth:`Item.delete `rˆh3jh4h5h6h—h8}r‰(UreftypeXmethhš‰h›Xboto.dynamodb.item.Item.deleteU refdomainXpyrŠh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAM>h-]r‹hŸ)rŒ}r(h2jˆh8}rŽ(h>]h?]r(h¤jŠXpy-methreh=]h<]h@]uh3j†h-]r‘hDX Item.deleter’…r“}r”(h2Uh3jŒubah6h©ubaubhDX method:r•…r–}r—(h2X method:h3jubeubhÁ)r˜}r™(h2Xž>>> table = conn.get_table('messages') >>> item = table.get_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item.delete()h3jqh4h5h6hÄh8}rš(h:h;h<]h=]h>]h?]h@]uhAMAhBhh-]r›hDXž>>> table = conn.get_table('messages') >>> item = table.get_item( hash_key='LOLCat Forum', range_key='Check this out!' ) >>> item.delete()rœ…r}rž(h2Uh3j˜ubaubeubhH)rŸ}r (h2Uh3hIh4h5h6hKh8}r¡(h>]h?]h=]h<]r¢h ah@]r£hauhAMJhBhh-]r¤(hP)r¥}r¦(h2XDeleting Tablesr§h3jŸh4h5h6hTh8}r¨(h>]h?]h=]h<]h@]uhAMJhBhh-]r©hDXDeleting Tablesrª…r«}r¬(h2j§h3j¥ubaubhz)r­}r®(h2XdDeleting a table will also **permanently** delete all of its contents without prompt. Use carefully.r¯h3jŸh4h5h6h}h8}r°(h>]h?]h=]h<]h@]uhANhBhh-]r±hZ)r²}r³(h2j¯h3j­h4h5h6h]h8}r´(h>]h?]h=]h<]h@]uhAMMh-]rµ(hDXDeleting a table will also r¶…r·}r¸(h2XDeleting a table will also h3j²ubh‡)r¹}rº(h2X**permanently**h8}r»(h>]h?]h=]h<]h@]uh3j²h-]r¼hDX permanentlyr½…r¾}r¿(h2Uh3j¹ubah6hubhDX: delete all of its contents without prompt. Use carefully.rÀ…rÁ}rÂ(h2X: delete all of its contents without prompt. Use carefully.h3j²ubeubaubhZ)rÃ}rÄ(h2X{There are two easy ways to delete a table. Through your top-level :py:class:`Layer2 ` object::h3jŸh4h5h6h]h8}rÅ(h>]h?]h=]h<]h@]uhAMOhBhh-]rÆ(hDXBThere are two easy ways to delete a table. Through your top-level rÇ…rÈ}rÉ(h2XBThere are two easy ways to delete a table. Through your top-level h3jÃubh“)rÊ}rË(h2X0:py:class:`Layer2 `rÌh3jÃh4h5h6h—h8}rÍ(UreftypeXclasshš‰h›Xboto.dynamodb.layer2.Layer2U refdomainXpyrÎh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAMOh-]rÏhŸ)rÐ}rÑ(h2jÌh8}rÒ(h>]h?]rÓ(h¤jÎXpy-classrÔeh=]h<]h@]uh3jÊh-]rÕhDXLayer2rÖ…r×}rØ(h2Uh3jÐubah6h©ubaubhDX object:rÙ…rÚ}rÛ(h2X object:h3jÃubeubhÁ)rÜ}rÝ(h2X>>> conn.delete_table(table)h3jŸh4h5h6hÄh8}rÞ(h:h;h<]h=]h>]h?]h@]uhAMRhBhh-]rßhDX>>> conn.delete_table(table)rà…rá}râ(h2Uh3jÜubaubhZ)rã}rä(h2X`Or by getting the table, then using :py:meth:`Table.delete `::h3jŸh4h5h6h]h8}rå(h>]h?]h=]h<]h@]uhAMThBhh-]ræ(hDX$Or by getting the table, then using rç…rè}ré(h2X$Or by getting the table, then using h3jãubh“)rê}rë(h2X::py:meth:`Table.delete `rìh3jãh4h5h6h—h8}rí(UreftypeXmethhš‰h›X boto.dynamodb.table.Table.deleteU refdomainXpyrîh<]h=]U refexplicitˆh>]h?]h@]hœhhíNhîNuhAMTh-]rïhŸ)rð}rñ(h2jìh8}rò(h>]h?]ró(h¤jîXpy-methrôeh=]h<]h@]uh3jêh-]rõhDX Table.deleterö…r÷}rø(h2Uh3jðubah6h©ubaubhDX:…rù}rú(h2X:h3jãubeubhÁ)rû}rü(h2X9>>> table = conn.get_table('messages') >>> table.delete()h3jŸh4h5h6hÄh8}rý(h:h;h<]h=]h>]h?]h@]uhAMWhBhh-]rþhDX9>>> table = conn.get_table('messages') >>> table.delete()rÿ…r}r(h2Uh3jûubaubhr)r}r(h2Xe.. _Data Model: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/DataModel.htmlhuKh3jŸh4h5h6hvh8}r(hijfh<]rh&ah=]h>]h?]h@]rhauhAM[hBhh-]ubhr)r}r(h2X‚.. _Provisioned Throughput: http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.htmlhuKh3jŸh4h5h6hvh8}r (hij†h<]r h*ah=]h>]h?]h@]r hauhAM\hBhh-]ubeubeubeh2UU transformerr NU footnote_refsr }rUrefnamesr}r(Xdynamodb]rhdaX data model]rjcaXprovisioned throughput]rjƒauUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rhBhU current_linerNUtransform_messagesr]rUreporterrNUid_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_referencesr0NUstrip_commentsr1NU toc_backlinksr2Uentryr3U language_coder4Uenr5U datestampr6NU report_levelr7KU _destinationr8NU halt_levelr9KU strip_classesr:NhTNUerror_encoding_error_handlerr;Ubackslashreplacer<Udebugr=NUembed_stylesheetr>‰Uoutput_encoding_error_handlerr?Ustrictr@U sectnum_xformrAKUdump_transformsrBNU docinfo_xformrCKUwarning_streamrDNUpep_file_url_templaterEUpep-%04drFUexit_status_levelrGKUconfigrHNUstrict_visitorrINUcloak_email_addressesrJˆUtrim_footnote_reference_spacerK‰UenvrLNUdump_pseudo_xmlrMNUexpose_internalsrNNUsectsubtitle_xformrO‰U source_linkrPNUrfc_referencesrQNUoutput_encodingrRUutf-8rSU source_urlrTNUinput_encodingrUU utf-8-sigrVU_disable_configrWNU id_prefixrXUU tab_widthrYKUerror_encodingrZUUTF-8r[U_sourcer\h5Ugettext_compactr]ˆU generatorr^NUdump_internalsr_NU smart_quotesr`‰U pep_base_urlraUhttp://www.python.org/dev/peps/rbUsyntax_highlightrcUlongrdUinput_encoding_error_handlerrej@Uauto_id_prefixrfUidrgUdoctitle_xformrh‰Ustrip_elements_with_classesriNU _config_filesrj]Ufile_insertion_enabledrkˆU raw_enabledrlKU dump_settingsrmNubUsymbol_footnote_startrnKUidsro}rp(h#hIh$j×hjh*jh jŸhjñh!j»h(hsh'j¶h,j h&jh+jh"jqh%h¬h)j<uUsubstitution_namesrq}rrh6hBh8}rs(h>]h<]h=]Usourceh5h?]h@]uU footnotesrt]ruUrefidsrv}rwub.