This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Overview

django-versions allows you to version the data stored in django models seamlessly. To get started all you need to do is to set VERSIONS_REPOSITORIES variable in your settings and configure the repositories you would like to use, then just subclass your Model from VersionsModel and start saving data:

from django.db import models
from versions.models import VersionsModel

class MyModel(VersionsModel):
    text = models.TextField()

Installation

Dependencies

  • Mercurial >= 1.5.2
  • Django == 1.1.X

Installing django-versions

If your are installing from source, you just need to run the following command from the base of the django-versions source tree:

python setup.py install

If you want to install the package without checking out the source you should run:

pip install django-versions

# OR if you don't have pip installed (you should definitely check out pip)
easy_install django-versions

For the time being, we need to patch Django to allow us to gain access to the related model from Manager classes. There is a patch included at the root of the source tree django.patch that includes the required changes. To patch django, go to the root of your checkout of django 1.1.X and run:

patch -p0 < /path/to/django-versions/django.patch

Add VERSIONS_REPOSITORIES to your settings file, pointing to the location where you would like django-versions to create and store your model history:

VERSIONS_REPOSITORIES = {
     'default': {
          'backend': 'versions.backends.hg',
          'local': '/path/to/my/projects/model/history',
          }
     }

Enabling Version Management

Install the VersionsMiddleware:

MIDDLEWARE_CLASSES = (
    ...
    'versions.middleware.VersionsMiddleware',
    ...
    )

Or handle enabling editing of Versioned models manually:

from versions.base import revision

@revision.commit_on_success
def my_editing_function(request):
    m = MyModel.objects.get(pk=1)
    m.save()


def my_other_editing_function(request):
    with revision:
        m = MyModel.objects.get(pk=1)
        m.save()
Release History

Release History

1.0.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-versions-1.0.1.tar.gz (22.0 kB) Copy SHA256 Checksum SHA256 Source Aug 17, 2010

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting