Commits

Jean-Tiare Le Bigot committed eb189d3

updated classifiers

Comments (0)

Files changed (2)

dynamodb_mapper/model.py

 
 
 log = logging.getLogger(__name__)
+dblog = logging.getLogger(__name__+".database-access")
 
 
 MAX_RETRIES = 100
         else:
             r_value = None
 
-        return cls.from_dict(
-            table.get_item(
-                hash_key=h_value,
-                range_key=r_value,
-                consistent_read=consistent_read))
+        item = table.get_item(
+                    hash_key=h_value,
+                    range_key=r_value,
+                    consistent_read=consistent_read)
+
+        dblog.debug("[GET] %s(%s, %s)", cls.__table__, h_value, r_value)
+
+        return cls.from_dict(item)
 
     @classmethod
     def get_batch(cls, keys):
         batch_list.add_batch(table, dynamo_keys)
 
         res = batch_list.submit()
+
+        dblog.debug("[BATCH GET] %s", cls.__table__)
+
         return [
             cls.from_dict(d) for d in res[u"Responses"][cls.__table__][u"Items"]
         ]
         """
         table = ConnectionBorg().get_table(cls.__table__)
         h_value = _python_to_dynamodb(hash_key_value)
-        return (
-            cls.from_dict(d)
-            for d in table.query(
+
+        res = table.query(
                 h_value,
                 range_key_condition,
                 consistent_read=consistent_read,
                 scan_index_forward=not reverse)
-        )
+
+        dblog.debug("[QUERY] %s(%s, %s)", cls.__table__, h_value, range_key_condition)
+
+        return (cls.from_dict(d) for d in res)
 
     @classmethod
     def scan(cls, scan_filter=None):
         """
         table = ConnectionBorg().get_table(cls.__table__)
         hash_key_name = table.schema.hash_key_name
+
+        res = table.scan(scan_filter)
+
+        dblog.debug("[QUERY] %s(%s)", cls.__table__, scan_filter)
+
         return (
             cls.from_dict(d)
-            for d in table.scan(scan_filter)
+            for d in res
             if d['key'] != MAGIC_KEY or cls.__schema__[hash_key_name] != autoincrement_int
         )
 
 [metadata]
 name = dynamodb-mapper
-version = 1.6.0
+version = 1.6.1
 summary = Object mapper for Amazon DynamoDB
 description_file = README.rst
 author = Max Noel
 author_email = mnoel@ludia.com
 classifiers =
+    Topic :: Internet
+    Topic :: Database :: Front-Ends
+    Operating System :: OS Independent
+    Intended Audience :: Developers
+    Development Status :: 5 - Production/Stable
+    Programming Language :: Python
+    Programming Language :: Python :: 2.7
     License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
 requires-dist =
     Sphinx