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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a3511e614b5608852da180cf1880b18deeb59055108aa5f98aad3bb2c1baff |
|
MD5 | a0c106ae09ee792672145000fe08e5cc |
|
BLAKE2b-256 | cc7636a5eaa4e660f89cfc4175cfc4a2866ddbbe97711a0afcc74698402fac79 |
Close
Hashes for django_modelformhistory-1.0.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bbedfcb3e0a96b0312759daf6ca078c223246fd33103efbacf4d05ea3e489533 |
|
MD5 | 341359f20af1d85f115acd349f93d91d |
|
BLAKE2b-256 | f5e37331d09c92fb8052ba2499f08db67fbd828a6ebe7e4a34eecc4629401d56 |