Skip to main content

No project description provided

Project description

Django ModelForm History

Build Status Coverage Status

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 a auth.User object

TODO

  • Provide generic views to see history by object, user & both
  • Improve doc
  • Querying models history easily
  • Add more support and tests for filefield, boolean
  • FR 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-modelformhistory-1.0.5a0.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_modelformhistory-1.0.5a0-py2-none-any.whl (11.9 kB view details)

Uploaded Python 2

File details

Details for the file django-modelformhistory-1.0.5a0.tar.gz.

File metadata

  • Download URL: django-modelformhistory-1.0.5a0.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.10

File hashes

Hashes for django-modelformhistory-1.0.5a0.tar.gz
Algorithm Hash digest
SHA256 1e6134d0ca2ec24906ae8fbed3778177c0c9730ee3250f830888e2a6bf9560f1
MD5 4dcb5ab0e1fcc0d54b0ee19def067bc9
BLAKE2b-256 3a644d855396e0fa2fa6f5e7c129feeabad660c9c19762790276059626baeca7

See more details on using hashes here.

File details

Details for the file django_modelformhistory-1.0.5a0-py2-none-any.whl.

File metadata

  • Download URL: django_modelformhistory-1.0.5a0-py2-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.10

File hashes

Hashes for django_modelformhistory-1.0.5a0-py2-none-any.whl
Algorithm Hash digest
SHA256 8f66639973e4257777ac4094efafb92f192e54f38037f862edf0e553c2d82485
MD5 8f9494ed4afbeede253808807b65779f
BLAKE2b-256 49b33a47d60b6afc3c45954d027f5aef4b91a325a35df3f7b388c22df43b8789

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page