OLD | NEW |
1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ | 1 # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ |
2 # | 2 # |
3 # Permission is hereby granted, free of charge, to any person obtaining a | 3 # Permission is hereby granted, free of charge, to any person obtaining a |
4 # copy of this software and associated documentation files (the | 4 # copy of this software and associated documentation files (the |
5 # "Software"), to deal in the Software without restriction, including | 5 # "Software"), to deal in the Software without restriction, including |
6 # without limitation the rights to use, copy, modify, merge, publish, dis- | 6 # without limitation the rights to use, copy, modify, merge, publish, dis- |
7 # tribute, sublicense, and/or sell copies of the Software, and to permit | 7 # tribute, sublicense, and/or sell copies of the Software, and to permit |
8 # persons to whom the Software is furnished to do so, subject to the fol- | 8 # persons to whom the Software is furnished to do so, subject to the fol- |
9 # lowing conditions: | 9 # lowing conditions: |
10 # | 10 # |
(...skipping 13 matching lines...) Expand all Loading... |
24 class Item(dict): | 24 class Item(dict): |
25 """ | 25 """ |
26 A ``dict`` sub-class that serves as an object representation of a | 26 A ``dict`` sub-class that serves as an object representation of a |
27 SimpleDB item. An item in SDB is similar to a row in a relational | 27 SimpleDB item. An item in SDB is similar to a row in a relational |
28 database. Items belong to a :py:class:`Domain <boto.sdb.domain.Domain>`, | 28 database. Items belong to a :py:class:`Domain <boto.sdb.domain.Domain>`, |
29 which is similar to a table in a relational database. | 29 which is similar to a table in a relational database. |
30 | 30 |
31 The keys on instances of this object correspond to attributes that are | 31 The keys on instances of this object correspond to attributes that are |
32 stored on the SDB item. | 32 stored on the SDB item. |
33 | 33 |
34 .. tip:: | 34 .. tip:: While it is possible to instantiate this class directly, you may |
35 While it is possible to instantiate this class directly, you may want | 35 want to use the convenience methods on :py:class:`boto.sdb.domain.Domain
` |
36 to use the convenience methods on :py:class:`boto.sdb.domain.Domain` | 36 for that purpose. For example, :py:meth:`boto.sdb.domain.Domain.get_item
`. |
37 for that purpose. For example, | |
38 :py:meth:`boto.sdb.domain.Domain.get_item`. | |
39 """ | 37 """ |
40 def __init__(self, domain, name='', active=False): | 38 def __init__(self, domain, name='', active=False): |
41 """ | 39 """ |
42 :type domain: :py:class:`boto.sdb.domain.Domain` | 40 :type domain: :py:class:`boto.sdb.domain.Domain` |
43 :param domain: The domain that this item belongs to. | 41 :param domain: The domain that this item belongs to. |
44 | 42 |
45 :param str name: The name of this item. This name will be used when | 43 :param str name: The name of this item. This name will be used when |
46 querying for items using methods like | 44 querying for items using methods like |
47 :py:meth:`boto.sdb.domain.Domain.get_item` | 45 :py:meth:`boto.sdb.domain.Domain.get_item` |
48 """ | 46 """ |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 Deletes this item in SDB. | 172 Deletes this item in SDB. |
175 | 173 |
176 .. note:: This local Python object remains in its current state | 174 .. note:: This local Python object remains in its current state |
177 after deletion, this only deletes the remote item in SDB. | 175 after deletion, this only deletes the remote item in SDB. |
178 """ | 176 """ |
179 self.domain.delete_item(self) | 177 self.domain.delete_item(self) |
180 | 178 |
181 | 179 |
182 | 180 |
183 | 181 |
OLD | NEW |