No project description provided
Project description
Django ModelForm History
django-modelformhistory will save your modelform updates and store the human-readable values. The main goal is only to show the users what has been updated on a modelForms. If you search for a more lowlevel history app, consider using django-reversion or django-simple-history
Warning
This package is under developpement. It has poor features and may be unstable. Don't use it in production yet.
Requirements
- Django 1.10.* / Django 1.11.*
- Tested under python 2.7 and 3.6
Install
pip install django-modelformhistory
Then, add modelformhistory
to INSTALLED_APPS
Usage
Inherit your ModelForm with HistoryModelFormMixin
from modelformhistory.forms import HistoryModelFormMixin
class MyModelForm(HistoryModelFormMixin, forms.ModelForm):
pass
You can get the user that has made the change by :
- Either pass the
request
on the form init, then the request.user will be automatically sent to the new history Entry - or implement a
get_history_user
method on your ModelForm that will return aauth.User
object
TODO
- Provide generic views to see history by object, user & both
- Improve doc
Querying models history easilyAdd more support and tests for filefield, booleanFR translation
ChangeLog
1.0.5 2019-06-19
- Added docstrings
- Added
models.HistoryBaseModel.log_custom_history
Entry.content_object
is now mandatory
1.0.4 2019-06-17
- Added support for BooleanField and FileField
1.0.3 2019-06-17
- Added more coverage
- Added FR translation
- Added HistoryBaseModel
1.0 2019-06-14
- Initial Release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-modelformhistory-1.0.5a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e6134d0ca2ec24906ae8fbed3778177c0c9730ee3250f830888e2a6bf9560f1 |
|
MD5 | 4dcb5ab0e1fcc0d54b0ee19def067bc9 |
|
BLAKE2b-256 | 3a644d855396e0fa2fa6f5e7c129feeabad660c9c19762790276059626baeca7 |
Close
Hashes for django_modelformhistory-1.0.5a0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f66639973e4257777ac4094efafb92f192e54f38037f862edf0e553c2d82485 |
|
MD5 | 8f9494ed4afbeede253808807b65779f |
|
BLAKE2b-256 | 49b33a47d60b6afc3c45954d027f5aef4b91a325a35df3f7b388c22df43b8789 |