mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 14:28:18 +00:00
Merge branch 'master' into dependabot/pip/mkdocs-material-9.6.11
This commit is contained in:
commit
625c1a4735
5 changed files with 28 additions and 12 deletions
12
README.md
12
README.md
|
@ -253,12 +253,17 @@ Read more about [HTML attributes](https://django-components.github.io/django-com
|
|||
|
||||
- Expose components as views with `get`, `post`, `put`, `patch`, `delete` methods
|
||||
|
||||
- Automatically create an endpoint for the component with `Component.Url.public`
|
||||
|
||||
```py
|
||||
# components/calendar/calendar.py
|
||||
@register("calendar")
|
||||
class Calendar(Component):
|
||||
template_file = "calendar.html"
|
||||
|
||||
class Url:
|
||||
public = True
|
||||
|
||||
class View:
|
||||
def get(self, request, *args, **kwargs):
|
||||
page = request.GET.get("page", 1)
|
||||
|
@ -274,8 +279,11 @@ class Calendar(Component):
|
|||
"page": page,
|
||||
}
|
||||
|
||||
# urls.py
|
||||
path("calendar/", Calendar.as_view()),
|
||||
# Get auto-generated URL for the component
|
||||
url = get_component_url(Calendar)
|
||||
|
||||
# Or define explicit URL in urls.py
|
||||
path("calendar/", Calendar.as_view())
|
||||
```
|
||||
|
||||
### Type hints
|
||||
|
|
|
@ -243,12 +243,17 @@ Read more about [HTML attributes](../../concepts/fundamentals/html_attributes/).
|
|||
|
||||
- Expose components as views with `get`, `post`, `put`, `patch`, `delete` methods
|
||||
|
||||
- Automatically create an endpoint for the component with `Component.Url.public`
|
||||
|
||||
```py
|
||||
# components/calendar/calendar.py
|
||||
@register("calendar")
|
||||
class Calendar(Component):
|
||||
template_file = "calendar.html"
|
||||
|
||||
class Url:
|
||||
public = True
|
||||
|
||||
class View:
|
||||
def get(self, request, *args, **kwargs):
|
||||
page = request.GET.get("page", 1)
|
||||
|
@ -264,8 +269,11 @@ class Calendar(Component):
|
|||
"page": page,
|
||||
}
|
||||
|
||||
# urls.py
|
||||
path("calendar/", Calendar.as_view()),
|
||||
# Get auto-generated URL for the component
|
||||
url = get_component_url(Calendar)
|
||||
|
||||
# Or define explicit URL in urls.py
|
||||
path("calendar/", Calendar.as_view())
|
||||
```
|
||||
|
||||
### Type hints
|
||||
|
|
|
@ -70,7 +70,7 @@ pytest==8.3.5
|
|||
# pytest-django
|
||||
pytest-asyncio==0.24.0
|
||||
# via -r requirements-ci.in
|
||||
pytest-django==4.10.0
|
||||
pytest-django==4.11.1
|
||||
# via -r requirements-ci.in
|
||||
pyyaml==6.0.2
|
||||
# via asv
|
||||
|
|
|
@ -40,7 +40,7 @@ filelock==3.16.1
|
|||
# via
|
||||
# tox
|
||||
# virtualenv
|
||||
flake8==7.1.2
|
||||
flake8==7.2.0
|
||||
# via
|
||||
# -r requirements-dev.in
|
||||
# flake8-pyproject
|
||||
|
@ -94,11 +94,11 @@ pluggy==1.5.0
|
|||
# tox
|
||||
pre-commit==4.2.0
|
||||
# via -r requirements-dev.in
|
||||
pycodestyle==2.12.1
|
||||
pycodestyle==2.13.0
|
||||
# via flake8
|
||||
pyee==12.0.0
|
||||
# via playwright
|
||||
pyflakes==3.2.0
|
||||
pyflakes==3.3.2
|
||||
# via flake8
|
||||
pygments==2.19.1
|
||||
# via
|
||||
|
@ -120,7 +120,7 @@ pytest==8.3.5
|
|||
# syrupy
|
||||
pytest-asyncio==0.24.0
|
||||
# via -r requirements-dev.in
|
||||
pytest-django==4.10.0
|
||||
pytest-django==4.11.1
|
||||
# via -r requirements-dev.in
|
||||
pyyaml==6.0.2
|
||||
# via
|
||||
|
|
|
@ -68,7 +68,7 @@ gitdb==4.0.12
|
|||
# via gitpython
|
||||
gitpython==3.1.44
|
||||
# via mkdocs-git-revision-date-localized-plugin
|
||||
griffe==1.7.1
|
||||
griffe==1.7.2
|
||||
# via mkdocstrings-python
|
||||
htmlmin2==0.1.13
|
||||
# via mkdocs-minify-plugin
|
||||
|
@ -152,7 +152,7 @@ mkdocstrings==0.29.1
|
|||
# via
|
||||
# hatch.envs.docs
|
||||
# mkdocstrings-python
|
||||
mkdocstrings-python==1.16.8
|
||||
mkdocstrings-python==1.16.10
|
||||
# via hatch.envs.docs
|
||||
mypy-extensions==1.0.0
|
||||
# via black
|
||||
|
@ -189,7 +189,7 @@ pymdown-extensions==10.14.3
|
|||
# markdown-exec
|
||||
# mkdocs-material
|
||||
# mkdocstrings
|
||||
pyparsing==3.2.2
|
||||
pyparsing==3.2.3
|
||||
# via mike
|
||||
python-dateutil==2.9.0.post0
|
||||
# via ghp-import
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue