Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Add required fields #16

@djc

Description

@djc

From schi...@gmail.com on June 12, 2008 05:43:28

It would be helpful to be able to programmatically add some constraints to
Couchdb data. The Python schema classes provide a nice place to do this.

Attached is a patch that adds an optional "required" parameter to fields.
When set to True, all instances must be created with a value for that field
(whether loaded from a database or created manually). When created manually
the initial value must be passed during construction. This also works with
default values as you would expect.

If this patch (or something like it) is accepted I'll also create a similar
patch that lets you specify an "options" parameter for fields that will
constrain values to only those values.

Attachment: schema.diff

Original issue: http://code.google.com/p/couchdb-python/issues/detail?id=15

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions