Metadata-Version: 2.4
Name: django-tastypie-extras
Version: 0.5
Summary: A set of Django tastypie extras (Multipart resource, smart paginator, SwaggerUI authentication)
Home-page: https://github.com/tomi77/django-tastypie-extras
Author: Tomasz Z Rup
Author-email: tomasz.rup@gmail.com
License: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
License-File: LICENSE
Requires-Dist: t77-date
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

======================
Django Tastypie extras
======================

.. image:: https://codeclimate.com/github/tomi77/django-tastypie-extras/badges/gpa.svg
   :target: https://codeclimate.com/github/tomi77/django-tastypie-extras
   :alt: Code Climate


A set of Django Tastypie extras.

Table of contents
=================

* `Resources`_

  * `MultipartResourceMixin`_
  * `ReadOnlyResourceMixin`_

* `Paginator`_

  * `SmartPaginator`_

* `Authentication`_

  * `SwaggerApiKeyAuthentication`_

* `Fields`_

  * `DurationField`_

Resources
=========

MultipartResourceMixin
----------------------

Resource with upload image possibility

ReadOnlyResourceMixin
---------------------

Raise `BadRequest` on `update`, `create` or `delete` request.

Paginator
=========

SmartPaginator
--------------

``SmartPaginator`` does not perform ``SELECT COUNT(*)`` when

* ``limit`` is 0 and ``offset`` is 0
* ``limit`` is greater than 0 and ``offset`` is 0 and length of ``self.objects`` is lower than ``limit``

Authentication
==============

SwaggerApiKeyAuthentication
---------------------------

`SwaggerUI` provides request authentication only through ``api_key`` parameter.
``SwaggerApiKeyAuthentication`` reads `username` and `api_key` from ``api_key`` request parameter.

Fields
======

DurationField
-------------

A field covering ``models.DurationField``. Serializes ``timedelta`` values to ``HH:MM:SS`` format.
Accepts interval strings on input and returns a ``timedelta`` object.
