A Django mixin for API data cache views
Project description
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
Install the package using pip:
pip install django_api_data_cache
Add ‘api_data_cache’ to your Django project’s INSTALLED_APPS list in the settings.py file:
INSTALLED_APPS = [ # ... 'rest_framework', 'api_data_cache', # ... ]
Usage
Import the APIDataCacheListViewMixin into your view module:
from api_data_cache.mixins import APIDataCacheListViewMixin
Inherit the APIDataCacheListViewMixin in your view class:
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']
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 Distribution
Close
Hashes for django_api_data_cache-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0793992c345fb66de0bd2c47267d0d9ff9866e5dd6481f772d60b089e94e435c |
|
MD5 | 1a713f482f8e0a543089685761608c5f |
|
BLAKE2b-256 | 78a03d159f57d76a38d9ae43e791263a6b52c223603a35fd49ceaadb1be35186 |