Better ViewSet Mixins
This release has breaking changes
There are now 4 ViewSet mixin classes for use with both detail and non-detail viewsets in DRF.
The following are the provided mixin classes and their use case:
LargeImageMixin
: for use with a standard, non-detailViewSet
. Users must implementget_path()
LargeImageDetailMixin
: for use with a detail viewset likeGenericViewSet
. Users must implementget_path()
LargeImageFileDetailMixin
: (most commonly used) for use with a detail viewset likeGenericViewSet
where the associated model has aFileField
storing the image data.LargeImageVSIFileDetailMixin
: (geospatial) for use with a detail viewset likeGenericViewSet
where the associated model has aFileField
storing the image data that is intended to be read with GDAL. This will access the data over GDAL's Virtual File System interface (a VSI path).
Most users will want to use LargeImageFileDetailMixin
Other changes:
- Style parameters can now be included as a JSON blob in the request body following the format specified by large-image
- The thumbnail, tile, and region endpoints now each have
.png
,.jpeg
, and.tif
variants where appropriate - DRF
ValidationError
s are raised for user-caused API errors (return 400 status on endpoint) - More usage examples