Commits

Jean-Tiare Le Bigot  committed 084b90b

address PR comments, fix potential bug in defaults loading

  • Participants
  • Parent commits efe43a7

Comments (0)

Files changed (2)

File docs/api/model.rst

 :ref:`defaults are provided <using-default-values>`, all fields are set to ``None``
 
 >>> data = MyModel(key=u"foo/bar")
->>> print data.key
-foo/bar
+>>> repr(data.key)
+"u'foo/bar'"
 
 About keys
 ==========
 DynamoDB-Mapper as part of 1.8.0 release cycle.
 
 Before writing any validator relying on Onctuous, there is a crucial point to
-take into account. Validators are ran when loading from DynamoDB *and* when saving
-to DynamoDB. ``Save`` stores the output of the validators while reading functions feeds the
+take into account. Validators are run when loading from DynamoDB *and* when saving
+to DynamoDB. ``save`` stores the output of the validators while reading functions feeds the
 validators with raw DynamoDB values that is to say, the serialized output of the
 validators.
 

File dynamodb_mapper/model.py

 """
 from __future__ import absolute_import
 
-import json
-import logging
+import json, logging, copy
 from datetime import datetime, timedelta, tzinfo
 
 from onctuous.schema import Schema
             if name in kwargs:
                 value = kwargs.get(name)
             elif name in defaults:
-                value = defaults[name]
+                value = copy.deepcopy(defaults[name])
             else:
                 value = None
             setattr(self, name, value)