rest_framework_mixins


Namerest_framework_mixins JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/Qu4tro/rest_framework_mixins
SummaryA collection of DRF mixins combinations
upload_time2023-12-10 01:23:42
maintainer
docs_urlNone
authorXavier Francisco
requires_python>=3.9,<4.0
licenseMIT
keywords django djangorestframework drf restframework rest_framework mixins
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # rest-framework-mixins

## Installation

`pip install rest_framework_mixins`

## Usage

This package provides all combinations of the mixins provided by rest_framework.  
All combinations follow the same format: `{initials}Mixin.

The initials correspond to the following methods, in this specific order:

- L: `list()`  
- R: `retrieve()`  
- C: `create()`  
- U: `update()`  
- P: `partial_update()`  
- D: `delete()`  

So for example, to import a mixin that gives us list, retrieve and create,
we can do the following:

```
from rest_framework_mixins import LRCMixin

class CreateListRetrieveViewSet(LRCMixin, viewsets.GenericViewSet):
    """
    A viewset that provides `retrieve`, `create`, and `list` actions.

    To use it, override the class and set the `.queryset` and
    `.serializer_class` attributes.
    """
    pass
```

> Adapted from [DRF's documentation](https://www.django-rest-framework.org/api-guide/viewsets/#example_3)

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/Qu4tro/rest_framework_mixins",
    "name": "rest_framework_mixins",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "django,djangorestframework,drf,restframework,rest_framework,mixins",
    "author": "Xavier Francisco",
    "author_email": "xavier.n.francisco@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/29/f8/efaa30b5b7eac786355b6a93dbea9f3581c1c0f23ec8f2e1fcca7656c09e/rest_framework_mixins-1.0.0.tar.gz",
    "platform": null,
    "description": "# rest-framework-mixins\n\n## Installation\n\n`pip install rest_framework_mixins`\n\n## Usage\n\nThis package provides all combinations of the mixins provided by rest_framework.  \nAll combinations follow the same format: `{initials}Mixin.\n\nThe initials correspond to the following methods, in this specific order:\n\n- L: `list()`  \n- R: `retrieve()`  \n- C: `create()`  \n- U: `update()`  \n- P: `partial_update()`  \n- D: `delete()`  \n\nSo for example, to import a mixin that gives us list, retrieve and create,\nwe can do the following:\n\n```\nfrom rest_framework_mixins import LRCMixin\n\nclass CreateListRetrieveViewSet(LRCMixin, viewsets.GenericViewSet):\n    \"\"\"\n    A viewset that provides `retrieve`, `create`, and `list` actions.\n\n    To use it, override the class and set the `.queryset` and\n    `.serializer_class` attributes.\n    \"\"\"\n    pass\n```\n\n> Adapted from [DRF's documentation](https://www.django-rest-framework.org/api-guide/viewsets/#example_3)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A collection of DRF mixins combinations",
    "version": "1.0.0",
    "project_urls": {
        "Homepage": "https://github.com/Qu4tro/rest_framework_mixins",
        "Repository": "https://github.com/Qu4tro/rest_framework_mixins"
    },
    "split_keywords": [
        "django",
        "djangorestframework",
        "drf",
        "restframework",
        "rest_framework",
        "mixins"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1cda69ad672e60521c097c7ce3db35620846799b8bcb2f06ea1c47859f5cc8ff",
                "md5": "5eec59739f2b168d4e7bddba25424214",
                "sha256": "bc24a9620ffc6ec1ddf8453ac988b2a0b633d3483124973a3e4503ce7ccdd04e"
            },
            "downloads": -1,
            "filename": "rest_framework_mixins-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5eec59739f2b168d4e7bddba25424214",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 5845,
            "upload_time": "2023-12-10T01:23:40",
            "upload_time_iso_8601": "2023-12-10T01:23:40.409321Z",
            "url": "https://files.pythonhosted.org/packages/1c/da/69ad672e60521c097c7ce3db35620846799b8bcb2f06ea1c47859f5cc8ff/rest_framework_mixins-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "29f8efaa30b5b7eac786355b6a93dbea9f3581c1c0f23ec8f2e1fcca7656c09e",
                "md5": "cda8b8b3be462d24135ebc2368903c58",
                "sha256": "f7e4d7115f88031b455b50e56e284657d53ca79fed38df012301cd4af085c74c"
            },
            "downloads": -1,
            "filename": "rest_framework_mixins-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cda8b8b3be462d24135ebc2368903c58",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 4157,
            "upload_time": "2023-12-10T01:23:42",
            "upload_time_iso_8601": "2023-12-10T01:23:42.010228Z",
            "url": "https://files.pythonhosted.org/packages/29/f8/efaa30b5b7eac786355b6a93dbea9f3581c1c0f23ec8f2e1fcca7656c09e/rest_framework_mixins-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-10 01:23:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Qu4tro",
    "github_project": "rest_framework_mixins",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "rest_framework_mixins"
}
        
Elapsed time: 0.15314s