Skip to content

Commit

Permalink
Merge pull request #711 from open-dynaMIX/history_cleanup_readme
Browse files Browse the repository at this point in the history
docs(history): document cleanup commands in README
  • Loading branch information
open-dynaMIX authored Oct 3, 2019
2 parents 8f6415c + dc58593 commit 1519a92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ If you wish to expose an API for querying previous revisions of documents, you n

If you enable this, make sure to also configure [visibilities](#visibility-classes) and [permissions](#permission-classes) for historical types.

##### Cleanup
You may want to periodically cleanup the historical records. There are two commands available for this:

- `clean_duplicate_history`: Historical records are always created when `save()` has been called on a model. This command removes all duplicates.
- `cleanup_history`: Remove all historical records, or the ones that are older than specified.

#### FormatValidators
FormatValidator classes can validate input data for answers, based on rules set on the question.

Expand Down
2 changes: 1 addition & 1 deletion caluma/form/tests/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_create_bucket_command(mocker):
@pytest.mark.parametrize("dry", [True, False])
@pytest.mark.parametrize("keep,kept", [("1 year", 2), ("1 day", 1), (None, 0)])
def test_cleanup_history_command(db, dry, keep, kept):
# we need to override the rehistered models dict in order to get rid of the
# we need to override the registered models dict in order to get rid of the
# fake models created in core tests
cleanup_history.registered_models = {
k: v for k, v in registered_models.items() if not k.startswith("core_")
Expand Down

0 comments on commit 1519a92

Please sign in to comment.