Skip to main content

Automatically create history database when perticular model is saved.

Project description

django-modify-history is a library to create object modification timeline using Django signal

Install

sudo pip install django-modify-history

or:

sudo pip install git+git://github.com/lambdalisue/django-modify-history.git#egg=django-modify-history

How to Use

  1. Append modify_history to INSTALLED_APPS

  2. run manage.py syncdb

  3. Add history_site.py to the app and write like below:

    from modify_history import site
    from modify_history.backends.basic import BasicHistoryBackend
    
    from models import Article
    
    class ArticleBackend(BasicHistoryBackend):
            pass
    site.register(Article, ArticleBackend)
  4. Use get_history_timelines template tags for get history list like below:

    {% extends 'base.html' %}
    {% load historytags %}
    
    {% block content %}
    <h2>History</h2>
    <ul>
            {% get_history_timelines as timelines %}
            {% for timeline in timelines %}
            <li>{{ timeline.get_message }} at {{ timeline.created_at|date }}</li>
            {% endfor %}
    </ul>
    {% endblock %}

Settings

HISTORY_ENABLE

Make history enable, to disable history app just set this False

HISTORY_USER_ATTRS

modify_history app find user from target object’s attrs. this is the list of name of attrs. default is ['updated_by', 'user', 'author', 'created_by']

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-modify-history-0.1rc2.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

django_modify_history-0.1rc2-py2.7.egg (23.0 kB view details)

Uploaded Source

File details

Details for the file django-modify-history-0.1rc2.tar.gz.

File metadata

File hashes

Hashes for django-modify-history-0.1rc2.tar.gz
Algorithm Hash digest
SHA256 d5e7004e7d98bae8e3a639c6a29fb32b109c18dd0c3c82397e439564c8d3f5c6
MD5 3b1d6e43017633f21100bed1347b06f5
BLAKE2b-256 d9a2c37596201d62f80519f5e11f35f18d44b3e536f69fc15a516cd329d024cd

See more details on using hashes here.

File details

Details for the file django_modify_history-0.1rc2-py2.7.egg.

File metadata

File hashes

Hashes for django_modify_history-0.1rc2-py2.7.egg
Algorithm Hash digest
SHA256 d565b0ee5fd12a6199b2c8d4c1dceb21c4aa61d59d9cabd78127552adc71f82e
MD5 b3385932349997268780d8ce40a1457d
BLAKE2b-256 951abbd2125a9f3dd82bf7d4629e382d9e673282cdafb3d55aa4f9b66ab1d2b3

See more details on using hashes here.

Supported by

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