acid icon indicating copy to clipboard operation
acid copied to clipboard

Unique index constraints, or validation callbacks

Open dw opened this issue 12 years ago • 0 comments

This is from the old TODO list. Uniqueness can already be done using constraints in meta.py:

@acid.meta.constraint
def is_unique(self):
    return MyModel.by_some_index.get(self.must_be_unique_value) is None

meta.py also supports triggers, which covers 'collection watches'.

Consider moving the triggers/constraints code down to the Collection class (since meta.py isn't going to be useful in every program).

dw avatar Sep 07 '13 09:09 dw