/usr/lib/python2.6/site-packages/boto/dynamodb2
NameSizeModeActions
exceptions.py19900644editdlrm
exceptions.pyc31040644editdlrm
exceptions.pyo31040644editdlrm
fields.py82920644editdlrm
fields.pyc108150644editdlrm
fields.pyo108150644editdlrm
items.py145220644editdlrm
items.pyc144720644editdlrm
items.pyo144720644editdlrm
layer1.py1429330644editdlrm
layer1.pyc1361630644editdlrm
layer1.pyo1361630644editdlrm
results.py65650644editdlrm
results.pyc59680644editdlrm
results.pyo59680644editdlrm
table.py541230644editdlrm
table.pyc485210644editdlrm
table.pyo485210644editdlrm
types.py8590644editdlrm
types.pyc8670644editdlrm
types.pyo8670644editdlrm
__init__.py17130644editdlrm
__init__.pyc9780644editdlrm
__init__.pyo9780644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyo (14472B)
Ñò Å-õSc@sPddklZddklZdefd„ƒYZdefd„ƒYZdS(iÿÿÿÿ(tdeepcopy(t DynamizertNEWVALUEcBseZRS((t__name__t __module__(((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyRstItemcBseZdZded„Zd„Zd„Zd„Zd„Z d„Z d„Z dd„Z d „Z d „Zd „ZeZd „Zdd „Zd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd„Zd„Zd„Zed„Zd„ZRS(s An object representing the item data within a DynamoDB table. An item is largely schema-free, meaning it can contain any data. The only limitation is that it must have data for the fields in the ``Table``'s schema. This object presents a dictionary-like interface for accessing/storing data. It also tries to intelligently track how data has changed throughout the life of the instance, to be as efficient as possible about updates. Empty items, or items that have no data, are considered falsey. cCsq||_||_h|_||_tƒ|_|idjo h|_n|iot|iƒ|_ndS(sà Constructs an (unsaved) ``Item`` instance. To persist the data in DynamoDB, you'll need to call the ``Item.save`` (or ``Item.partial_save``) on the instance. Requires a ``table`` parameter, which should be a ``Table`` instance. This is required, as DynamoDB's API is focus around all operations being table-level. It's also for persisting schema around many objects. Optionally accepts a ``data`` parameter, which should be a dictionary of the fields & values of the item. Optionally accepts a ``loaded`` parameter, which should be a boolean. ``True`` if it was preexisting data loaded from DynamoDB, ``False`` if it's new data from the user. Default is ``False``. Example:: >>> users = Table('users') >>> user = Item(users, data={ ... 'username': 'johndoe', ... 'first_name': 'John', ... 'date_joined': 1248o61592, ... }) # Change existing data. >>> user['first_name'] = 'Johann' # Add more data. >>> user['last_name'] = 'Doe' # Delete data. >>> del user['date_joined'] # Iterate over all the data. >>> for field, val in user.items(): ... print "%s: %s" % (field, val) username: johndoe first_name: John date_joined: 1248o61592 N(ttablet_loadedt _orig_datat_dataRt _dynamizertNoneR(tselfRtdatatloaded((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyt__init__s*       cCs|ii|dƒS(N(R tgetR (R tkey((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyt __getitem__PscCs||i|>> user.needs_save() False >>> user['first_name'] = 'Johann' >>> user.needs_save() True RRR N(R R)tFalsetlentTrue(R R t needs_savetkind((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyR-˜s  cCst|iƒ|_dS(sM Marks an ``Item`` instance as no longer needing to be saved. Example: >>> user.needs_save() False >>> user['first_name'] = 'Johann' >>> user.needs_save() True >>> user.mark_clean() >>> user.needs_save() False N(RR R(R ((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyt mark_cleanµscCsdS(sß DEPRECATED: Marks an ``Item`` instance as needing to be saved. This method is no longer necessary, as the state tracking on ``Item`` has been improved to automatically detect proper state. N((R ((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyt mark_dirtyÇscCsgh|_x<|idhƒiƒD]"\}}|ii|ƒ||>> user['last_name'] = 'Doh!' # Only the last name field will be sent to DynamoDB. >>> user.partial_save() R@RA( R8RKR*RtremovetKeyErrorRDRt _update_itemR/(R RRER@t fieldnameRRAtreturned((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyt partial_saveps      cCsp|iƒ o | otS|iƒ}d}|tjo|iƒ}n|ii|d|ƒ}|iƒ|S(sU Saves all data to DynamoDB. By default, this attempts to ensure that none of the underlying data has changed. If any fields have changed in between when the ``Item`` was constructed & when it is saved, this call will fail so as not to cause any data loss. If you're sure possibly overwriting data is acceptable, you can pass an ``overwrite=True``. If that's not acceptable, you may be able to use ``Item.partial_save`` to only write the changed field data. Optionally accepts an ``overwrite`` parameter, which should be a boolean. If you provide ``True``, the item will be forcibly overwritten within DynamoDB, even if another process changed the data in the meantime. (Default: ``False``) Returns ``True`` on success, ``False`` if no save was performed. Example:: >>> user['last_name'] = 'Doh!' # All data on the Item is sent to DynamoDB. >>> user.save() # If it fails, you can overwrite. >>> user.save(overwrite=True) RAN(R-R*RFR RDRt _put_itemR/(R t overwriteRERARP((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pytsavežs   cCs|iƒ}|ii|S(sª Deletes the item's data to DynamoDB. Returns ``True`` on success. Example:: # Buh-bye now. >>> user.delete() (R8Rt delete_item(R R7((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pytdeleteËs N(RRt__doc__R R*RRRRRRRRRRRt __nonzero__R)R-R/R0R4R8R;RDR#RFRKRQRTRV(((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyR s66           $     4  $ . -N(tcopyRtboto.dynamodb2.typesRtobjectRR(((s8/usr/lib/python2.6/site-packages/boto/dynamodb2/items.pyts