Django File Context
=============================
.. image:: https://gitlab.sigmageosistemas.com.br/dev/django-file-context/badges/master/coverage.svg
.. image:: https://gitlab.sigmageosistemas.com.br/dev/django-file-context/badges/master/pipeline.svg
.. image:: https://readthedocs.org/projects/django-file-context/badge/?version=latest
File Context provides an easy way to store different documents/attachments
Documentation
-------------
The full documentation is at https://django-file-context.readthedocs.io.
Quickstart
----------
Install Django File Context::
pip install django-file-context
Add it to your `INSTALLED_APPS`:
.. code-block:: python
INSTALLED_APPS = (
...
'file_context.apps.FileContextConfig',
...
)
You need to add this to your INSTALLED_APPS, because we have our own
models.
Add Django File Context's URL patterns:
.. code-block:: python
from file_context import urls as file_context_urls
urlpatterns = [
...
url(r'^', include(file_context_urls)),
...
]
This is optional. Actually, you can include your own URLs.
Features
--------
* Generic File model so you can store different kinds of files, images,
etc, using a single model;
* Attach/Detach the file model to other models
* Cool descriptor, so you don't have to keep mangling GenericForeignKeys
inside your models.
Usage
-----
1. First of all, define your first model
:: python
from file_context.managers import Files
class MyModel(models.Model):
name = models.CharField(max_length=128)
files = Files()
2. That's it.
3. You can use the Files API to attach files to MyModel instances, using:
:: python
uploaded_file = File.objects.get(pk=1)
a = MyModel.objects.create(name='foo')
a.files.attach(uploaded_file)
a.files.detach(uploaded_file)
a.files.clear()
Running Tests
-------------
Does the code actually work?
::
source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ tox
Credits
-------
Tools used in rendering this package:
* Huge props to django-taggit that inspired me to do the descritor
idea!
* Cookiecutter_
* `cookiecutter-djangopackage`_
.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`cookiecutter-djangopackage`: https://github.com/pydanny/cookiecutter-djangopackage
History
-------
0.1.0 (2017-10-25)
++++++++++++++++++
* First release on PyPI.
Metadata
Release files for django-file-context 0.2.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-file-context-0.2.9.tar.gz | 10.9 kB | Without provenance | Details for django-file-context-0.2.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_file_context-0.2.9-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for django_file_context-0.2.9-py2.py3-none-any.whl |
Total release size: 24.3 kB
Release files / django-file-context-0.2.9.tar.gz
| Download URL | django-file-context-0.2.9.tar.gz |
|---|---|
| Size | 10.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21f93a52ca0884426c305554d7f59d2c04d0219061a98a8ed561edbc6defafd0
|
|
BLAKE2b-256 checksum How to use checksums |
c448747296b3623cfb64348137dd6f65821bb56487ff917c67cb4b42a373a367
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / django_file_context-0.2.9-py2.py3-none-any.whl
| Download URL | django_file_context-0.2.9-py2.py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
be4d2d58ed1e2339b827d129a2fd9a68c83a2b9eaac00d2792643278c8d215c8
|
|
BLAKE2b-256 checksum How to use checksums |
5bc194862796701638dcd0a6d1bc91e6373fa50f96e95d2275b0df667bb373a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-file-context 0.2.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.