{ "info": { "author": "TERENA", "author_email": "eperez@yaco.es", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "django-vff\n==========\n\nIntroduction\n------------\n\nThis package offers a file field for django models, that stores the file contents under a VCS (version control system). Everytime a field of this type is changed for a particular model instance, the new content will be commited as a new version in the repository. Thus, there will be one file in the repository for each vff field and instance. The repository will be at ``settings.VFF_REPO_ROOT``, or, if that is unset, at a ``vf_repo`` subdirectory of django's ``settings.MEDIA_ROOT``.\n\nDifferent VCSs can be used to manage the repository, using pluggable backends. The package only provides a `GIT `_ backend out of the box.\n\nInstallation\n------------\n\nInstall django-vff like you would install any other pypi package::\n\n $ pip install django-vff\n\nYou do not need to add anything into Django's ``INSTALLED_APPS``.\n\nConfiguration\n-------------\n\nYou have to set the following variables in django's ``settings.py``:\n\n``VFF_BACKEND``\n A dotted name leading to a backend class, e.g. ``\"vff.git_backend.GitBackend\"``. This setting is required.\n\nFor the git backend:\n\n``VFF_REPO_ROOT``\n Absolute path to the location of the git repository. This repository may or may not exist before setting up django-vff.\n``VFF_REPO_PATH``\n Relative path within the git repository to the directory where django-vff keeps its managed files.\n\nIf these two settings for the git backend are not set, ``VFF_REPO_ROOT`` will assume a value of ``os.path.join(settings.MEDIA_ROOT, 'vf_repo')``, and ``VFF_REPO_PATH`` will assume a value of ``''``.\n\nUsage\n-----\n\nYou use it like you would use ``django.db.models.FileField``::\n\n from django.db import models\n from vff.field import VersionedFileField\n\n\n class MyModel(models.Model):\n name = models.CharField('Name', max_length=128)\n content = VersionedFileField(name='content', verbose_name='file content')\n\n\nOnce you have an instance of the ``MyModel`` class, you can use three special methods to list available versions, to get specific versions, and to get diffs between versions:\n\n * list revisions::\n\n >>> revs = instance.content.list_revisions()\n >>> from pprint import pprint\n >>> pprint(revs)\n [{'author': u'John Smith',\n 'date': datetime.datetime(2011, 6, 16, 13, 25, 30),\n 'message': u'second version',\n 'versionid': 'a64ea785e195bbf4b3064e6701adbdbf4b5d13be'},\n {'author': u'Martha Brown',\n 'date': datetime.datetime(2011, 6, 16, 8, 24, 36),\n 'message': u'first version',\n 'versionid': '048848a70205d0e18d836f403e2a02830492cbf9'}]\n\n * get the string content of a specific revision::\n\n >>> rev1_id = revs[-1]['versionid']\n >>> instance.content.get_revision(rev1_id)\n u'These are the contents of the first version of the file'\n\n * get the diff between two revisions::\n\n >>> rev2_id = revs[-2]['versionid']\n >>> print instance.content.get_diff(rev1_id, rev2_id)\n --- 048848a70205d0e18d836f403e2a02830492cbf9\n \n +++ a64ea785e195bbf4b3064e6701adbdbf4b5d13be\n \n @@ -1,1 +1,1 @@\n \n -These are the contents of the first version of the file\n +These are the contents of the second version of the file\n\nSaving and deleting\n+++++++++++++++++++\n\nAt the moment, saving and deleting has to be explicitly done for this field. So, for example, if you have a model instance with a ``content`` vff field, and a view that uses an edit form with a ``forms.FileField`` for it, after validating the form you would have to do something like::\n\n name = instance.content.name\n content = form['content'].data\n username = request.user.username\n commit_msg = form['commit_msg'].data.encode('utf8')\n instance.content.save(name, content, username, commit_msg)\n instance.save()\n\nLikewise, when removing an instance, you would::\n\n username = request.user.username\n commit_msg = u'entity removed'\n instance.content.delete(username, commit_msg)\n instance.delete()\n\nIn the future, if there is interest, the package could include a special widget with input space for the necessary data (commit message, etc) so that saving and deleting would be transparent.\n\nProviding new backends\n----------------------\n\nTo develop a new backend for django-vff, you have to subclass the abstract base class ``vff.abcs.VFFBackend``. The methods that need to be implemented are documented in the docstrings of the class.\n\n\nCHANGES\n=======\n\n0.2b2 (2012-01-25)\n------------------\n\n - Fix typo on README.txt\n - Fix uncaught exception during initialization of GIT repository.\n\n0.2b1 (2012-01-24)\n------------------\n - The (git) repo can now be anywhere in the filesystem (not necessarily inside the MEDIA_ROOT), and django-vff can be told to keep its files in a subdirectory iof the repo.\n\n0.1b4 (2011-10-01)\n------------------\n - Better fix for error when deleting objects with no file in the repo.\n\n0.1b3 (2011-10-01)\n------------------\n - Do not fail deleting objects with no file in the repo.\n\n0.1b2 (2011-09-20)\n------------------\n - Remove the files from the repository when deleting objects.\n - Change the signature of VersionedFieldFile's save and delete so they are compatible with django's FieldFile.\n\n0.1b1 (2011-09-02)\n------------------\n - Initial version which includes a VersionedFileField and a git backend.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Yaco-Sistemas/django-vff", "keywords": "django versioned file field vcs model git", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-vff", "package_url": "https://pypi.org/project/django-vff/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-vff/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/Yaco-Sistemas/django-vff" }, "release_url": "https://pypi.org/project/django-vff/0.2b3/", "requires_dist": null, "requires_python": null, "summary": "Versioned file field for django models", "version": "0.2b3" }, "last_serial": 1407682, "releases": { "0.1a1dev": [ { "comment_text": "", "digests": { "md5": "936ec84b702031040a111f4ed9130a5d", "sha256": "a85f5605b7a9d9ff483df23601cf15eb7e3fc78ffe3d718b85d7d9539f2fbcdf" }, "downloads": -1, "filename": "django-vff-0.1a1dev.tar.gz", "has_sig": false, "md5_digest": "936ec84b702031040a111f4ed9130a5d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5561, "upload_time": "2011-06-15T17:54:33", "url": "https://files.pythonhosted.org/packages/7d/c8/f37f614a4b60c9e6f5256ce99c17b36f47a9d7abe8c07b71fd98463304ac/django-vff-0.1a1dev.tar.gz" } ], "0.1b1": [ { "comment_text": "", "digests": { "md5": "8f6ed99779d3334b7b3cadb2e4fbb3c2", "sha256": "9900abfb07d8590d7e8d3c8d83e1c38acf8390bc6499fb201505151eb65e42b9" }, "downloads": -1, "filename": "django-vff-0.1b1.tar.gz", "has_sig": false, "md5_digest": "8f6ed99779d3334b7b3cadb2e4fbb3c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8070, "upload_time": "2011-09-02T14:22:55", "url": "https://files.pythonhosted.org/packages/3e/c6/04787dcd043b6d1183ae2b4642df1686ce1b52ce326a890899021115cb68/django-vff-0.1b1.tar.gz" } ], "0.1b2": [ { "comment_text": "", "digests": { "md5": "8f8b8a068d028c03fcac64490ec702c4", "sha256": "2218bb686e6bdf70dd7cfccb2b965cf7bc181a55772ccea3230f394006d13267" }, "downloads": -1, "filename": "django-vff-0.1b2.tar.gz", "has_sig": false, "md5_digest": "8f8b8a068d028c03fcac64490ec702c4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9901, "upload_time": "2011-09-23T13:35:37", "url": "https://files.pythonhosted.org/packages/96/5b/53d47fa59fd7f019b5b67b72e852e3e6fa8f07f40ff002926c01200b833c/django-vff-0.1b2.tar.gz" } ], "0.1b3": [ { "comment_text": "", "digests": { "md5": "3a7554048655425fcf6f0e8d7c98809b", "sha256": "b142a912362481c4068e0250073461d7085ccc4907c25ad518ed2ca36c77266a" }, "downloads": -1, "filename": "django-vff-0.1b3.tar.gz", "has_sig": false, "md5_digest": "3a7554048655425fcf6f0e8d7c98809b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9981, "upload_time": "2011-09-30T09:49:05", "url": "https://files.pythonhosted.org/packages/cc/d3/0b5194d462efd69c91f9ee95619c4dde9d77b1a7033910c4315f0097d437/django-vff-0.1b3.tar.gz" } ], "0.1b4": [ { "comment_text": "", "digests": { "md5": "1c97b013fe9c61271d8ab1a248d2f206", "sha256": "6fff07381c490896ed6e834cf3cb446d63d7215581e2b8114fe265d0c76710cc" }, "downloads": -1, "filename": "django-vff-0.1b4.tar.gz", "has_sig": false, "md5_digest": "1c97b013fe9c61271d8ab1a248d2f206", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10026, "upload_time": "2011-09-30T11:13:34", "url": "https://files.pythonhosted.org/packages/70/1c/a20ec9aac98b81fbf2bb9b74ef78b4d79f4e78429dbd19fb18b6635f90f6/django-vff-0.1b4.tar.gz" } ], "0.2b1": [ { "comment_text": "", "digests": { "md5": "5bbdd7c6371c4662de70f9df5000297a", "sha256": "cdd190cb5b8ce62f7cd5fc262ed46958a816ab2afc0f7ed276cf588ba8d7e761" }, "downloads": -1, "filename": "django-vff-0.2b1.tar.gz", "has_sig": false, "md5_digest": "5bbdd7c6371c4662de70f9df5000297a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10637, "upload_time": "2012-01-24T13:37:43", "url": "https://files.pythonhosted.org/packages/ac/0e/dcef3815b783d3867ad9f5f494a751f46b71d2a101e820b07d045e032e91/django-vff-0.2b1.tar.gz" } ], "0.2b2": [ { "comment_text": "", "digests": { "md5": "4ae4db5494a2940638c7ef71ef437e4a", "sha256": "480d22861fbe96ca29ffc0a375269acf55b013184c0f85388ddbee19c5cf3dad" }, "downloads": -1, "filename": "django-vff-0.2b2.tar.gz", "has_sig": false, "md5_digest": "4ae4db5494a2940638c7ef71ef437e4a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10783, "upload_time": "2012-01-25T16:26:14", "url": "https://files.pythonhosted.org/packages/9c/f1/71f95a37b62a60435e00f9b97438f9fd0dab98536074180528e576d8b641/django-vff-0.2b2.tar.gz" } ], "0.2b3": [ { "comment_text": "", "digests": { "md5": "9b49642953b0f059a29f054f024d5c9e", "sha256": "0930a9c9dae2b88db6df84d2798a7fe0dce549c49fe6387a5b45fa3bcef695b2" }, "downloads": -1, "filename": "django-vff-0.2b3.tar.gz", "has_sig": false, "md5_digest": "9b49642953b0f059a29f054f024d5c9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10233, "upload_time": "2015-02-03T12:07:59", "url": "https://files.pythonhosted.org/packages/57/7d/5ae38b53c060f8fead8d595d471f8c0c365f3cd6932ceb4e89fdb4aaa73e/django-vff-0.2b3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9b49642953b0f059a29f054f024d5c9e", "sha256": "0930a9c9dae2b88db6df84d2798a7fe0dce549c49fe6387a5b45fa3bcef695b2" }, "downloads": -1, "filename": "django-vff-0.2b3.tar.gz", "has_sig": false, "md5_digest": "9b49642953b0f059a29f054f024d5c9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10233, "upload_time": "2015-02-03T12:07:59", "url": "https://files.pythonhosted.org/packages/57/7d/5ae38b53c060f8fead8d595d471f8c0c365f3cd6932ceb4e89fdb4aaa73e/django-vff-0.2b3.tar.gz" } ] }