Duplicated default handler

Create issue
Issue #18 new
Jean-Tiare Le Bigot created an issue

As of version 1.8.0 (yet to be released), there are 2 ways to specify default values behaving differently :

  1. __default__ dictionnary
  2. Required marker from Onctuous

While __default__ is only taken into account when instanciating a new object, default value from Required marker will be loaded each time validate is called, that is to say at least at each save call.

Moreover, when using it into a sub-dict (i.e in a nested schema, not the parent one) it will also be loaded whenever an Object in loaded from the database.

This is a quite tricky part of DynamoDB-Mapper: _dynamodb_to_python basically reproduces the Onctuous dict validator behavior, default excepted. This is intended to preserve backward-compatibility.

Comments (0)

  1. Log in to comment