Skip to main content

Enable in any Model class an change history of all inserts, updates and deletes

Project description

django-model-history

https://travis-ci.org/goinnn/django-model-history.png https://coveralls.io/repos/goinnn/django-model-history/badge.png https://badge.fury.io/py/django-model-history.png

Enable in any Model class an change history of all inserts, updates and deletes

Installation

In your settings.py

Only you need it, if you want the translation of django-model-history

INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.admin',

    #.....................#

    'model_history',
)

Option 1: In your models.py

Only you have to update the parent class of your model.

from django.db import models


class MyModel(models.Model):
    ....
from model_history.models import ModelHistoryProvider


class MyModel(ModelHistoryProvider):
    ....

...

Option 1 example.

Option 2: In your models.py

from django.db import models


from model_history.models import create_history_model_class, BaseModelHistory

class MyModel(models.Model):
    ....


MyModelHistory = create_history_model_class(MyModel, (BaseModelHistory,))

Option 2 example.

Development

You can get the last bleeding edge version of django-model-history by doing a clone of its git repository

git clone https://github.com/goinnn/django-model-history

Example project

https://raw.githubusercontent.com/goinnn/django-model-history/0.1.0/example/uml.png

In the source tree, you will find a directory called example. It contains a readily setup project that uses django-model-history. You can run it as usual:

python manage.py makemigrations
python manage.py syncdb --noinput
python manage.py runserver

Access in a browser to http://localhost:8000/

0.1.1 (2015-04-24)

  • Fix typo error

0.1.0 (2015-04-24)

  • Initial version

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-model-history-0.1.1.tar.gz (4.9 kB view details)

Uploaded Source

File details

Details for the file django-model-history-0.1.1.tar.gz.

File metadata

File hashes

Hashes for django-model-history-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d71c0614e35b43afa7d7a154d906e04d206ebec2c494ce1bf5fb4f92a64ef6a2
MD5 b73b868e2e69cb9cce1f268843444d48
BLAKE2b-256 389815efc66518b405d00dbbb0a884e98b0cc60e201141090652c8378d933d8b

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