Skip to content
This repository has been archived by the owner on Sep 5, 2019. It is now read-only.

Commit

Permalink
Document the new features
Browse files Browse the repository at this point in the history
  • Loading branch information
msom committed Jun 10, 2016
1 parent b10e58c commit 405d308
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
6 changes: 3 additions & 3 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Changelog
---------

- Adds the ability to depend on not a specific field value.
[msom]
- Adds new options on how to dependen on a field value.

- Adds the ability to depend on more then one fields (AND).
It's now possible to depend on NOT a specific field value and to depend on
more then one fields (AND).
[msom]

0.11.2 (2016-05-11)
Expand Down
11 changes: 11 additions & 0 deletions onegov/form/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,17 @@ def __call__(self, *args, **kwargs):
class FieldDependency(object):
""" Defines a dependency to a field. The given field(s) must have the given
choice for this dependency to be fulfilled.
It's possible to depend on NOT the given value by preceeding it with a '!':
FieldDependency('field_1', '!choice_1')
To depend on more than one field, add the field_id's and choices to the
constructor:
FieldDependency('field_1', 'choice_1')
FieldDependency('field_1', 'choice_1', 'field_2', 'choice_2')
"""

def __init__(self, *kwargs):
Expand Down

0 comments on commit 405d308

Please sign in to comment.