=======================================
Django API Data Cache
=======================================
API Data Cache is a simple mixin for Django REST framework to serve database
objects to clients using the api_data_cache service.
It is composed of a mixing for list views that processes the request parameters from api_data_cache
clients for pagination and filtering.
Installation
------------
1. Install the package using pip:
.. code-block:: bash
pip install django_api_data_cache
2. Add `'api_data_cache'` to your Django project's `INSTALLED_APPS` list in the `settings.py` file:
.. code-block:: python
INSTALLED_APPS = [
# ...
'rest_framework',
'api_data_cache',
# ...
]
Usage
-----
1. Import the `APIDataCacheListViewMixin` into your view module:
.. code-block:: python
from api_data_cache.mixins import APIDataCacheListViewMixin
2. Inherit the `APIDataCacheListViewMixin` in your view class:
.. code-block:: python
from api_data_cache.mixins import APIDataCacheListViewMixin
from rest_framework import viewsets
from .models import YourModel
from .serializer import YourPartialSerializer
class YourListView(APIDataCacheListViewMixin, viewsets.GenericViewSet):
queryset = YourModel.objects.all()
serializer_class = YourPartialSerializer
search_fields = ['field1', 'field2']
Raw data
{
"_id": null,
"home_page": "https://github.com/cviolbarbosa/django-api-data-cache",
"name": "django-api-data-cache",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Carlos Viol Barbosa",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/9e/68/3b2bda84550d068fdfb33fdf219962812d76a212096193526b91f0a2cd67/django_api_data_cache-0.2.1.tar.gz",
"platform": null,
"description": "=======================================\nDjango API Data Cache\n=======================================\n\nAPI Data Cache is a simple mixin for Django REST framework to serve database\nobjects to clients using the api_data_cache service.\n\nIt is composed of a mixing for list views that processes the request parameters from api_data_cache \nclients for pagination and filtering.\n\n\nInstallation\n------------\n\n1. Install the package using pip:\n\n .. code-block:: bash\n\n pip install django_api_data_cache\n\n\n2. Add `'api_data_cache'` to your Django project's `INSTALLED_APPS` list in the `settings.py` file:\n\n .. code-block:: python\n\n INSTALLED_APPS = [\n # ...\n 'rest_framework',\n 'api_data_cache',\n # ...\n ]\n\n\n\nUsage\n-----\n\n1. Import the `APIDataCacheListViewMixin` into your view module:\n\n .. code-block:: python\n\n from api_data_cache.mixins import APIDataCacheListViewMixin\n\n2. Inherit the `APIDataCacheListViewMixin` in your view class:\n\n .. code-block:: python\n\n from api_data_cache.mixins import APIDataCacheListViewMixin\n from rest_framework import viewsets\n from .models import YourModel\n from .serializer import YourPartialSerializer\n\n\n class YourListView(APIDataCacheListViewMixin, viewsets.GenericViewSet):\n queryset = YourModel.objects.all()\n serializer_class = YourPartialSerializer\n search_fields = ['field1', 'field2']",
"bugtrack_url": null,
"license": "",
"summary": "A Django mixin for API data cache views",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/cviolbarbosa/django-api-data-cache"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e683b2bda84550d068fdfb33fdf219962812d76a212096193526b91f0a2cd67",
"md5": "597d1f007e32f47fbaffb5d6076cd581",
"sha256": "3f76b60b0158d44d8660decb2be80c5a18fa7df6f74b78772877c9398b029693"
},
"downloads": -1,
"filename": "django_api_data_cache-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "597d1f007e32f47fbaffb5d6076cd581",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 5603,
"upload_time": "2023-08-16T13:53:06",
"upload_time_iso_8601": "2023-08-16T13:53:06.513281Z",
"url": "https://files.pythonhosted.org/packages/9e/68/3b2bda84550d068fdfb33fdf219962812d76a212096193526b91f0a2cd67/django_api_data_cache-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-16 13:53:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "cviolbarbosa",
"github_project": "django-api-data-cache",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "django-api-data-cache"
}