Anonymous avatar Anonymous committed 7bc28ca

update autoinc doc

Comments (0)

Files changed (2)

docs/api/alter.rst

 other cases, it is :py:class:`~.ConflictError`.
 
 Please note that :py:class:`~.ConflictError` inherits from :py:class:`~.OverwriteError`.
-If you make a distinction between both cases, ``OverwriteError`` must be the 
+If you make a distinction between both cases, ``OverwriteError`` must be the
 first ``except`` block.
 
 .. _save-use-case:
 When saving an Item with an :py:class:`~.autoincrement_int` ``hash_key``, the
 :py:meth:`~.DynamoDBModel.save` method will automatically add checks to prevent
 accidental overwrite of the "magic item". The magic item holds the last allocated
-ID and is saved at ``hash_key=-1``. If ``hash_key == 0`` then a new ID is
+ID and is saved at ``hash_key=-1``. If ``hash_key is None`` then a new ID is
 automatically and atomically allocated meaning that no collision can occure even
 if the database connection is lost. Additionaly, a check is performed to make
 sure no Item were manually inserted to this location. If applicable, a maximum

dynamodb_mapper/model.py

     Inserting a new item issues an atomic add on the '__max_hash_key__' value.
     Its new value is returned and used as the primary key for the new elem.
 
-    Note that hash_key_value is set to '-1' while ``__max_hash_key__`` initial
-    value is 0. This will element at key '0' unused. It's actually a garbage item
-    for cases where a value is manually added to an unitialized index.
+    Note that hash_key_value is set to '-1' while ``__max_hash_key__`` implicit
+    initial value is 0. This guarantees element at key '0' is unused. It's actually
+    a garbage item for cases where a value is manually added to an unitialized index.
     """
 
 _JSON_TYPES = frozenset([list, dict])
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.