TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #227 623
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Support `Path` with `*args` (#754)


Right now Path component only supports parsing from request.kwargs. Which is like 99% of cases.
However, parsing from request.args is not supported:

django-modern-rest/dmr/components.py

Lines 655 to 662 in b3f9c08

What should we do instead?

1. When request.args is provided we should require models like:

>>> import pydantic
>>> class UserId(pydantic.BaseModel):
... user_id: int

>>> PathModel = pydantic.RootModel[tuple[tuple[int, ...], UserId]]

>>> PathModel.model_validate((('1', '2', '3'), {'user_id': 10}))
RootModel[tuple[tuple[int, ...], UserId]](root=((1, 2, 3), UserId(user_id=10)))

1. We would return tuple[Args, Kwargs] from this component if request.args is set
2. Test this with unnamed re_path urls https://docs.djangoproject.com/en/6.0/topics/http/urls/#using-unnamed-regular-expression-groups
3. Test this in tests/test_unit/test_components/test_path.py
4. Document this feature in docs/pages/components/path.rst
5. Provide an example in docs/examples/components/path_args.py and include it to path.rst
6. Provide a changelog entry
7. Remove _UNNAMED_PATH_PARAMS_MSG and all translations of this string, recompile all translations with make translations

Contributions are welcome! This is an intermediate level task :)


#enhancement #good_first_issue #help_wanted #django_modern_rest
sent via relator
More from @opensource_findings_python
  1. Sep 23, 2026🚀 New issue to ag2ai/faststream by @IvanKirpichnikov 📝 Feature: Implementation of the `A…
  2. Sep 22, 2026🚀 New issue to faststream-community/zMQTT by @borisalekseev 📝 Mark flaky Artemis test xf…
  3. Sep 17, 2026Помните про https://github.com/ozeranskii/httptap? Я писал о нем давно еще - > тут. Наклеп…
  4. Sep 15, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `test_custom_union_form…
  5. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @milssky 📝 Changes in benchmarking…
  6. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Fix `operation_id` defa…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →