sentry-forked-djangorestframework-stubs


Namesentry-forked-djangorestframework-stubs JSON
Version 3.15.1.post1 PyPI version JSON
download
home_pagehttps://github.com/typeddjango/djangorestframework-stubs
SummaryPEP-484 stubs for django-rest-framework
upload_time2024-09-12 14:01:25
maintainerMarti Raudsepp
docs_urlNone
authorMaksim Kurnikov
requires_python>=3.8
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            sentry-forked-djangorestframework-stubs
=======================================

### new release

make a new branch for the fork of an upstream tag:

```bash
git remote add upstream git@github.com:typeddjango/djangorestframework-stubs
git fetch upstream --tags
git push origin --tags
git checkout 1.2.3 -b sentry-1.2.3
```

- cherry-pick the craft / release commit(s) into your branch from `master`
- cherry-pick relevant commit(s) from previous releases

releases are done through craft in the release.yml workflow -- make sure to
target your particular branch with a `-#` release postfix (like `1.2.3-1`)

___

<img src="http://mypy-lang.org/static/mypy_light.svg" alt="mypy logo" width="300px"/>

# pep484 stubs for Django REST framework

[![Build Status](https://travis-ci.com/typeddjango/djangorestframework-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/djangorestframework-stubs)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)
[![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby)


Mypy stubs for [Django REST Framework](https://pypi.org/project/djangorestframework/).
Supports Python 3.8 and up.

## Installation

```bash
pip install djangorestframework-stubs[compatible-mypy]
```

To make mypy aware of the plugin, you need to add

```ini
[mypy]
plugins =
    mypy_drf_plugin.main
```

in your `mypy.ini` file.

## FAQ

### Model instance is inferred as `Any` instead of my `Model` class

When subclassing `ModelSerializer`, add a [type argument](https://peps.python.org/pep-0484/#generics) to type-hint the related model class, for example:

```python
class MyModelSerializer(serializers.ModelSerializer[MyModel]):
    class Meta:
        model = MyModel
        fields = ("id", "example")
```

Which means that methods where the model is being passed around will know the actual type of the model instead of being `Any`. The `instance` attribute on the above serializer will be `Union[MyModel, typing.Sequence[MyModel], None]`.

## To get help

We have Gitter here: <https://gitter.im/mypy-django/Lobby>
If you think you have more generic typing issue, please refer to <https://github.com/python/mypy> and their Gitter.

## Contributing

This project is open source and community driven. As such we encourage contributions big and small. You can contribute by doing any of the following:

1. Contribute code (e.g. improve stubs, add plugin capabilities, write tests etc) - to do so please follow the [contribution guide](./CONTRIBUTING.md).
2. Assist in code reviews and discussions in issues.
3. Identify bugs and issues and report these

You can always also reach out in gitter to discuss your contributions!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/typeddjango/djangorestframework-stubs",
    "name": "sentry-forked-djangorestframework-stubs",
    "maintainer": "Marti Raudsepp",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "marti@juffo.org",
    "keywords": null,
    "author": "Maksim Kurnikov",
    "author_email": "maxim.kurnikov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/8a/e0/2994d6f6cb69538405e7cdc70d5196f676be114a520d1ea209fe8dfb651b/sentry_forked_djangorestframework_stubs-3.15.1.post1.tar.gz",
    "platform": null,
    "description": "sentry-forked-djangorestframework-stubs\n=======================================\n\n### new release\n\nmake a new branch for the fork of an upstream tag:\n\n```bash\ngit remote add upstream git@github.com:typeddjango/djangorestframework-stubs\ngit fetch upstream --tags\ngit push origin --tags\ngit checkout 1.2.3 -b sentry-1.2.3\n```\n\n- cherry-pick the craft / release commit(s) into your branch from `master`\n- cherry-pick relevant commit(s) from previous releases\n\nreleases are done through craft in the release.yml workflow -- make sure to\ntarget your particular branch with a `-#` release postfix (like `1.2.3-1`)\n\n___\n\n<img src=\"http://mypy-lang.org/static/mypy_light.svg\" alt=\"mypy logo\" width=\"300px\"/>\n\n# pep484 stubs for Django REST framework\n\n[![Build Status](https://travis-ci.com/typeddjango/djangorestframework-stubs.svg?branch=master)](https://travis-ci.com/typeddjango/djangorestframework-stubs)\n[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby)\n\n\nMypy stubs for [Django REST Framework](https://pypi.org/project/djangorestframework/).\nSupports Python 3.8 and up.\n\n## Installation\n\n```bash\npip install djangorestframework-stubs[compatible-mypy]\n```\n\nTo make mypy aware of the plugin, you need to add\n\n```ini\n[mypy]\nplugins =\n    mypy_drf_plugin.main\n```\n\nin your `mypy.ini` file.\n\n## FAQ\n\n### Model instance is inferred as `Any` instead of my `Model` class\n\nWhen subclassing `ModelSerializer`, add a [type argument](https://peps.python.org/pep-0484/#generics) to type-hint the related model class, for example:\n\n```python\nclass MyModelSerializer(serializers.ModelSerializer[MyModel]):\n    class Meta:\n        model = MyModel\n        fields = (\"id\", \"example\")\n```\n\nWhich means that methods where the model is being passed around will know the actual type of the model instead of being `Any`. The `instance` attribute on the above serializer will be `Union[MyModel, typing.Sequence[MyModel], None]`.\n\n## To get help\n\nWe have Gitter here: <https://gitter.im/mypy-django/Lobby>\nIf you think you have more generic typing issue, please refer to <https://github.com/python/mypy> and their Gitter.\n\n## Contributing\n\nThis project is open source and community driven. As such we encourage contributions big and small. You can contribute by doing any of the following:\n\n1. Contribute code (e.g. improve stubs, add plugin capabilities, write tests etc) - to do so please follow the [contribution guide](./CONTRIBUTING.md).\n2. Assist in code reviews and discussions in issues.\n3. Identify bugs and issues and report these\n\nYou can always also reach out in gitter to discuss your contributions!\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "PEP-484 stubs for django-rest-framework",
    "version": "3.15.1.post1",
    "project_urls": {
        "Funding": "https://github.com/sponsors/typeddjango",
        "Homepage": "https://github.com/typeddjango/djangorestframework-stubs",
        "Release notes": "https://github.com/typeddjango/djangorestframework-stubs/releases"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "81437aea606484d985ca74ed4d2fe8099892ef342fc9ff4f2b788d15c5fabbbe",
                "md5": "3e49bafc7330b3728cfb2df9b868f3ff",
                "sha256": "e7b66b2e482967ed0f923375531bb068faec16e7a9fc31a75d2b265c3ef52033"
            },
            "downloads": -1,
            "filename": "sentry_forked_djangorestframework_stubs-3.15.1.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3e49bafc7330b3728cfb2df9b868f3ff",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 54886,
            "upload_time": "2024-09-12T14:01:24",
            "upload_time_iso_8601": "2024-09-12T14:01:24.324583Z",
            "url": "https://files.pythonhosted.org/packages/81/43/7aea606484d985ca74ed4d2fe8099892ef342fc9ff4f2b788d15c5fabbbe/sentry_forked_djangorestframework_stubs-3.15.1.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ae02994d6f6cb69538405e7cdc70d5196f676be114a520d1ea209fe8dfb651b",
                "md5": "42f07169cf080f08d660deee6be3ffe9",
                "sha256": "515244c5d2d57d87e6e0f7cafef78130405a2658df278a47740465fb3d73a91a"
            },
            "downloads": -1,
            "filename": "sentry_forked_djangorestframework_stubs-3.15.1.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "42f07169cf080f08d660deee6be3ffe9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 36576,
            "upload_time": "2024-09-12T14:01:25",
            "upload_time_iso_8601": "2024-09-12T14:01:25.366067Z",
            "url": "https://files.pythonhosted.org/packages/8a/e0/2994d6f6cb69538405e7cdc70d5196f676be114a520d1ea209fe8dfb651b/sentry_forked_djangorestframework_stubs-3.15.1.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-12 14:01:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "typeddjango",
    "github_project": "djangorestframework-stubs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "sentry-forked-djangorestframework-stubs"
}
        
Elapsed time: 1.15846s