sentry-forked-djangorestframework-stubs


Namesentry-forked-djangorestframework-stubs JSON
Version 3.16.2.post1 PyPI version JSON
download
home_pagehttps://github.com/typeddjango/djangorestframework-stubs
SummaryPEP-484 stubs for django-rest-framework
upload_time2025-08-14 18:40:53
maintainerMarti Raudsepp
docs_urlNone
authorMaksim Kurnikov
requires_python>=3.10
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

[![test](https://github.com/typeddjango/djangorestframework-stubs/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/typeddjango/djangorestframework-stubs/actions/workflows/test.yml)
[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
[![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby)
[![StackOverflow](https://shields.io/badge/ask-stackoverflow-orange?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/django-stubs?tab=Active)


Mypy stubs for [Django REST Framework](https://pypi.org/project/djangorestframework/).
Supports Python 3.10 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 `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.10",
    "maintainer_email": "marti@juffo.org",
    "keywords": null,
    "author": "Maksim Kurnikov",
    "author_email": "maxim.kurnikov@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cd/aa/8dcb355f95879023dea509b4bf15477a33312bda9d62fd770738b9374dd5/sentry_forked_djangorestframework_stubs-3.16.2.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[![test](https://github.com/typeddjango/djangorestframework-stubs/actions/workflows/test.yml/badge.svg?branch=master&event=push)](https://github.com/typeddjango/djangorestframework-stubs/actions/workflows/test.yml)\n[![Checked with mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)\n[![Gitter](https://badges.gitter.im/mypy-django/Lobby.svg)](https://gitter.im/mypy-django/Lobby)\n[![StackOverflow](https://shields.io/badge/ask-stackoverflow-orange?logo=stackoverflow)](https://stackoverflow.com/questions/tagged/django-stubs?tab=Active)\n\n\nMypy stubs for [Django REST Framework](https://pypi.org/project/djangorestframework/).\nSupports Python 3.10 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 `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.16.2.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": null,
            "digests": {
                "blake2b_256": "bc1d4973063b8b5cc7884d70b9c7e9b18da64ab95f0550a306baaba91d4e854d",
                "md5": "9f976458dca814ff64a06660ea2e368b",
                "sha256": "b4eb81f20c4f05bfed81c624b46e4768b4d57c9dc205486f4bb26c357071b489"
            },
            "downloads": -1,
            "filename": "sentry_forked_djangorestframework_stubs-3.16.2.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9f976458dca814ff64a06660ea2e368b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 55076,
            "upload_time": "2025-08-14T18:40:52",
            "upload_time_iso_8601": "2025-08-14T18:40:52.514846Z",
            "url": "https://files.pythonhosted.org/packages/bc/1d/4973063b8b5cc7884d70b9c7e9b18da64ab95f0550a306baaba91d4e854d/sentry_forked_djangorestframework_stubs-3.16.2.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cdaa8dcb355f95879023dea509b4bf15477a33312bda9d62fd770738b9374dd5",
                "md5": "3575ac4edc04f8e59c86d404e7cd8b1c",
                "sha256": "86f2d1c2ba1eba2db732bc6b9656f93f7bb3b94542ec4f08125f38ade2687196"
            },
            "downloads": -1,
            "filename": "sentry_forked_djangorestframework_stubs-3.16.2.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "3575ac4edc04f8e59c86d404e7cd8b1c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 36882,
            "upload_time": "2025-08-14T18:40:53",
            "upload_time_iso_8601": "2025-08-14T18:40:53.703706Z",
            "url": "https://files.pythonhosted.org/packages/cd/aa/8dcb355f95879023dea509b4bf15477a33312bda9d62fd770738b9374dd5/sentry_forked_djangorestframework_stubs-3.16.2.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-14 18:40:53",
    "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: 2.08351s