django-validate-on-save is a Django app that automatically calls full_clean() on models during save() to prevent invalid data being saved.
Surprisingly, this does not happen by default, apparently for backwards compatibility reasons.
Adding to your Django Project
Requires Django 1.4 or 1.3.
Call validate_on_save.validate_models_on_save('your_app_name') from your app's models.py (I put this call near the end of models.py, not sure whether this matters).
Publishing releases to PyPI
To publish a new version of django-validate-on-save to PyPI, set the __version__ string in validate_on_save/__init__.py, then run:
# Run the tests against multiple environments
# Publish to PyPI
# Tag (change 1.0.0 to the version you are publishing!)
git tag -a v1.0.0 -m 'Version 1.0.0'
git push --tags
Running the tests
To run the tests against the current environment:
To run the tests against multiple environments, install tox using pip install tox, make sure you're not currently in a virtual environment, then simply run tox: