Field validation and enforcement on document instantiation. #53
Labels
2.enhancement
New ideas or improvements.
area:document
Issues relating to the Document dictionary–compatible implementation.
area:field
Issues relating to Field implementations or their mechanics.
Hi,
I came across your project a few days ago, looking for some alternatives to an in-house mongo-wrapper and schema-definition utility.
I was super impressed with marrow-mongo, and the entire echo-system, and I've been trying to use it in my project.
I'm trying to define a document structure with some required fields, and with type validation on each field. Unfortunately, I was not able to get any of these validations to work out of the box (see ipython snippet).
It looks as though the
required
attribute is completely ignored, and so does the validator attribute (however, I was able to enforce validation by adding theValidated
mixin to theField
class, but this will force me to redefine each field type I wish to use).Looking at the code, I wasn't able to find anywhere where these validations are enforced by default, but I'm probably missing something. I'd appreciate you help.
Thanks!
The text was updated successfully, but these errors were encountered: