{ "info": { "author": "James Pic", "author_email": "jamespic@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "django-documents\n================\n\nThis simple app provides:\n\n- a Document model with:\n\n - a generic many to many relation\n - a file field that uploads to a private directory\n - a method get_download_url()\n- a view to download a document which allows custom security checks through a\n signal\n- a signal, document_pre_download, that is emited by the download view, and\n which responds with 503 if emiting the signal raises a DownloadForbidden\n exception\n- clean admin integration\n- south support\n\nInstall django-generic-m2m\n--------------------------\n\nRefer to `django-generic-m2m installation documentation\n`_, do \"Installation\" and \"Adding to your Django Project\".\n\nInstall autocomplete_light\n--------------------------\n\nRefer to `django-autocomplete-light installation documentation\n`_, do \"Quick install\" and \"Quick admin integration\".\n\nInstall django-documents\n------------------------\n\nDownload the lastest release::\n\n pip install django-documents\n\nOr install the development version::\n\n pip install -e git+https://github.com/yourlabs/django-documents.git#egg=documents\n\nAdd to settings.INSTALLED_APPS::\n\n 'documents',\n\nIf using south, run::\n\n ./manage.py migrate\n\nElse, run::\n\n ./manage.py syncdb\n\nAdd to urls.py::\n\n url(r'^documents/', include('documents.urls')),\n\n**Set settings.DOCUMENTS_UPLOAD_TO** to the absolute path where uploads should\nbe stored. This must be a private directory.\n\nPrepare the generic many to many autocomplete\n---------------------------------------------\n\nRegister a `generic autocomplete\n`_,\nwith name \"AutocompleteDocumentRelations\". There is an example in `test_project\n`_ which is imported in `urls.py\n`_.\nRefer the `django-autocomplete-light documentation about the registry\n`_\nfor alternative methods.\n\nIf the project already uses django-generic-m2m and django-autocomplete-light, a\ngood solution is to re-register the project's generic autocomplete with\nname='AutocompleteDocumentRelations', ie.::\n\n # your project specific autocomplete\n class AutocompleteProject(autocomplete_light.AutocompleteGenericBase):\n # ....\n\n # register for your project needs\n autocomplete_light.register(AutocompleteProject)\n\n # registery for documents relations\n autocomplete_light.register(AutocompleteProject,\n name='AutocompleteDocumentRelations')\n\nSecure your documents\n---------------------\n\nConnect to document_pre_import, for example::\n\n # project specific document permissions\n import documents\n def document_security(sender, request, document, **kwargs):\n if not request.user.is_staff:\n raise documents.DownloadForbidden()\n documents.document_pre_download.connect(document_security)\n\nDisplay documents related to a model\n------------------------------------\n\nUse get_related_documents() from Python::\n\n from documents.models import get_related_documents\n\n your_model = YourModel.objects.get(pk=XXX)\n\n related_documents = get_related_documents(your_model)\n\nOr from a template::\n\n {% load documents_tags %}\n\n {% for document in your_model|get_related_documents %}\n {{ document }}\n {% endfor %}\n\nNote that get_related_documents() returns a QuerySet, ie. you can get a count::\n\n get_related_documents(your_model).count()\n\nOr from a template::\n\n {% with related_documents=your_model|get_related_documents %}\n {{ related_documents.count }}\n {% endwith %}", "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/yourlabs/django-documents", "keywords": "django document", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-documents", "package_url": "https://pypi.org/project/django-documents/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-documents/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/yourlabs/django-documents" }, "release_url": "https://pypi.org/project/django-documents/0.0.3/", "requires_dist": null, "requires_python": null, "summary": "Attach documents to django models", "version": "0.0.3" }, "last_serial": 789492, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "0d6f5289dc15425ae879fe14a64cdfda", "sha256": "3f709f879bb6b280d6f787f53a60ae0edb4ce1cde89f5859a02991383ca3d823" }, "downloads": -1, "filename": "django-documents-0.0.1.tar.gz", "has_sig": false, "md5_digest": "0d6f5289dc15425ae879fe14a64cdfda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5271, "upload_time": "2012-07-11T14:55:36", "url": "https://files.pythonhosted.org/packages/51/28/6eee26fe76a8b35773defffd2a0a30473702e4d69022d366dade59b14b77/django-documents-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "d1c9e117032fac7c0b1089e9b4a493ea", "sha256": "383505743bd28480f827a7f9b7bc56d8fa7de64186acb28e9fa37b3e581e1f1f" }, "downloads": -1, "filename": "django-documents-0.0.2.tar.gz", "has_sig": false, "md5_digest": "d1c9e117032fac7c0b1089e9b4a493ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5317, "upload_time": "2012-07-11T15:23:35", "url": "https://files.pythonhosted.org/packages/3d/c2/300d9db660d990b3c80ec847522f47337a0ab1f20fbfedbdb699b1e23e93/django-documents-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5b927975824bece245a997a0b06ef225", "sha256": "3791bd53cf8866244f397fbf3dbd2a66cb2f67d05aa0bfb23565a7adb78e4804" }, "downloads": -1, "filename": "django-documents-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5b927975824bece245a997a0b06ef225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10200, "upload_time": "2012-07-12T13:43:40", "url": "https://files.pythonhosted.org/packages/71/12/a893d363f87f9d21ff30626efc96be07ba2800a78ec9d91886dc1a9b3360/django-documents-0.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5b927975824bece245a997a0b06ef225", "sha256": "3791bd53cf8866244f397fbf3dbd2a66cb2f67d05aa0bfb23565a7adb78e4804" }, "downloads": -1, "filename": "django-documents-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5b927975824bece245a997a0b06ef225", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10200, "upload_time": "2012-07-12T13:43:40", "url": "https://files.pythonhosted.org/packages/71/12/a893d363f87f9d21ff30626efc96be07ba2800a78ec9d91886dc1a9b3360/django-documents-0.0.3.tar.gz" } ] }