Name | django-rest-envelope JSON |
Version |
1.0.0
JSON |
| download |
home_page | |
Summary | A mixin for Django REST package List Views to return an object instead of a list. |
upload_time | 2023-04-04 18:18:24 |
maintainer | |
docs_url | None |
author | |
requires_python | >=3.8 |
license | |
keywords |
django
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Django REST Envelop
Turn the ViewSet list endpoints to return an object rather than a list directly.
## Installation
From PYPi using `pip`:
```
pip install django-rest-envelope
```
## Usage
In your viewset views, you can use the `ListEnvelopeMixin` along with another mixin that defines the `list()` method:
```python
class MyViewSet(ListEnvelopeMixin, ReadOnlyModelViewSet):
envelope: "my_envelope"
```
In your ViewSet class that uses the mixin you have to define the `envelope` attribute.
Additionally, you can overwrite the `get_envelope()` method to tweak the behaviour of
which envelope use in different situations.
## Licence
This package is distributed under [MIT Licence](./LICENCE).
Raw data
{
"_id": null,
"home_page": "",
"name": "django-rest-envelope",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "django",
"author": "",
"author_email": "Ferran Jovell <ferran.jovell+gh@gmail.com>",
"download_url": "",
"platform": null,
"description": "# Django REST Envelop\n\nTurn the ViewSet list endpoints to return an object rather than a list directly.\n\n## Installation\n\nFrom PYPi using `pip`:\n\n```\npip install django-rest-envelope\n```\n\n## Usage\n\nIn your viewset views, you can use the `ListEnvelopeMixin` along with another mixin that defines the `list()` method:\n\n```python\nclass MyViewSet(ListEnvelopeMixin, ReadOnlyModelViewSet):\n envelope: \"my_envelope\"\n```\n\nIn your ViewSet class that uses the mixin you have to define the `envelope` attribute.\n\nAdditionally, you can overwrite the `get_envelope()` method to tweak the behaviour of\nwhich envelope use in different situations.\n\n## Licence\n\nThis package is distributed under [MIT Licence](./LICENCE).\n",
"bugtrack_url": null,
"license": "",
"summary": "A mixin for Django REST package List Views to return an object instead of a list.",
"version": "1.0.0",
"split_keywords": [
"django"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "82a8a96e1a41ff57305d22fd64a9a3af96f76ae9039b3353b112e8ae2dc6e695",
"md5": "4931c420a6add149cf6755d13b61e3fb",
"sha256": "5b967df33430fc15c5dcd2deef979ca5cae4c114c58675f71fb43aa8f95b2cb8"
},
"downloads": -1,
"filename": "django_rest_envelope-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4931c420a6add149cf6755d13b61e3fb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 3367,
"upload_time": "2023-04-04T18:18:24",
"upload_time_iso_8601": "2023-04-04T18:18:24.775027Z",
"url": "https://files.pythonhosted.org/packages/82/a8/a96e1a41ff57305d22fd64a9a3af96f76ae9039b3353b112e8ae2dc6e695/django_rest_envelope-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-04 18:18:24",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "django-rest-envelope"
}