From 17651cb11a648ac49c08ed54994032a45c0298e1 Mon Sep 17 00:00:00 2001 From: Fabio Caccamo Date: Fri, 23 Sep 2022 14:08:29 +0200 Subject: [PATCH] Update `README`, `CHANGELOG` and version. --- CHANGELOG.md | 3 +++ README.md | 4 ++++ extra_settings/version.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71b7e34..4e2414c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.6.0](https://github.com/fabiocaccamo/django-extra-settings/releases/tag/0.5.1) - 2022-07-05 +- Add custom validator support to settings. Fix #33 by [@domeniconappo](https://github.com/domeniconappo) in #34. + ## [0.5.1](https://github.com/fabiocaccamo/django-extra-settings/releases/tag/0.5.1) - 2022-07-05 - Fixed admin static css media bug. diff --git a/README.md b/README.md index 90fb6c8..b45bc33 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,10 @@ setting_obj.value = False setting_obj.save() ``` +#### Validators +Each setting can have its own validator, defined using its full python path, eg. `myapp.mymodule.my_validator`. +Validators receive a single argument, the value of the setting, and they should return `True` only if the value is valid, otherwise a `ValidationError` is raised. + #### Delete ```python from extra_settings.models import Setting diff --git a/extra_settings/version.py b/extra_settings/version.py index 7f482c3..36a2e09 100644 --- a/extra_settings/version.py +++ b/extra_settings/version.py @@ -1,3 +1,3 @@ # -*- coding: utf-8 -*- -__version__ = "0.5.1" +__version__ = "0.6.0"