mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 22:38:00 +00:00
feat: component URL (#1088)
* feat: allow to set defaults * refactor: remove input validation and link to it * feat: component URL * refactor: fix linter errors * refactor: fix linter errors + update examples to use Component.View..get * docs: update comment * refactor: revert change to hash_comp_cls * docs: update comment
This commit is contained in:
parent
3555411f1e
commit
a49f5e51dd
37 changed files with 987 additions and 314 deletions
16
README.md
16
README.md
|
@ -259,13 +259,15 @@ Read more about [HTML attributes](https://django-components.github.io/django-com
|
|||
class Calendar(Component):
|
||||
template_file = "calendar.html"
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
page = request.GET.get("page", 1)
|
||||
return self.render_to_response(
|
||||
kwargs={
|
||||
"page": page,
|
||||
}
|
||||
)
|
||||
class View:
|
||||
def get(self, request, *args, **kwargs):
|
||||
page = request.GET.get("page", 1)
|
||||
return Calendar.render_to_response(
|
||||
request=request,
|
||||
kwargs={
|
||||
"page": page,
|
||||
},
|
||||
)
|
||||
|
||||
def get_context_data(self, page):
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue