Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/luzfcb/django-versioning
[MIRROR] django-versioning
https://github.com/luzfcb/django-versioning
Last synced: 25 days ago
JSON representation
[MIRROR] django-versioning
- Host: GitHub
- URL: https://github.com/luzfcb/django-versioning
- Owner: luzfcb
- License: bsd-3-clause
- Created: 2015-06-30T18:20:47.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-06-30T19:07:50.000Z (over 9 years ago)
- Last Synced: 2024-04-16T02:29:20.937Z (7 months ago)
- Language: Python
- Homepage:
- Size: 234 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
==========================
[MIRROR] Django-Versioning
==========================Django-versioning allows you to version the data stored in django models, and stores only diff, not content copy.
Supports all field types excepts ManyToMany (currently).
Django-versioning as small as possible, and follows the `KISS principle `_.
Home Page: https://bitbucket.org/emacsway/django-versioning
Usage
======settings.py::
MIDDLEWARE_CLASSES = [
# ...
"versioning.middleware.VersioningMiddleware",
# ...
]
# ...
INSTALLED_APPS = [
# ...
'versioning', # Should be after apps with versioned models
# ...
]wiki/models.py::
from django.db import models
from django.contrib.auth.models import User
import versioningclass Article(models.Model):
title = models.CharField()
body = models.TextField()
is_active = models.BooleanField()
weight = models.IntegerField(blank=True, null=True)
creator = models.ForeignKey(User, blank=True, null=True)
class Meta:
permissions = (
("wiki.browse_revision_article", "Can browse revisions"),
("wiki.reapply_revision_article", "Can repply revision"),
)versioning.register(
Article,
['title', 'body', 'is_active', 'weight', 'creator', ]
)wiki/templates/wiki/article_detail.html::
...
View the list of revisions.
...If you have already existent content, to create a first revision, simple run::
./manage.py versioning_setup wiki.Article -f
You can also view revisions in admin, by clicking "History" button on change object page.
Forked from https://github.com/brosner/django-versioning , Thanks to Brian Rosner.