Add a Django field class to your models to track the git revision with every model instance saved.
Project description
# django-revision
Add a Django field class to your models to track the git revision with every model instance saved. (Uses GitPython)
For example:
from django.db import models
from revision import RevisionField
class TestModel(models.Model):
revision = RevisionField()
Reference git information from anywhere in your app:
>>> from revision import site_revision >>> site_revision.tag '1.0' >>>site_revision.revision 'master:4c9c7f4f40e8db109d2b7b6d234defbe9d065d74'
Installation
pip install django-revision
If BASE_DIR does not exist in settings, add it:
BASE_DIR = Path(os.path.dirname(os.path.realpath(__file__)))
Description
For research trial data, we need to track the source code revision at time of data collection.
We deploy our source as a git branch and django-revision picks up the tag or branch:commit and updates each saved model instance as data is collected.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Hashes for django_revision-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb2d4edb5fb817bbd760e92439282e0d82d6424fdee2abd17d29e7be9197ff93 |
|
MD5 | a5895d46d166157d3bc21c3e3e24b51b |
|
BLAKE2b-256 | 4060ac023c6061abcdd52817f62e1bddae21c1217389339b1c6afa97bdb5d437 |