Skip to content

Commit a9fcc80

Browse files
committed
Remove django from htmx readme
1 parent 8995651 commit a9fcc80

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

bolt-htmx/bolt/htmx/README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# bolt-htmx
1+
# HTMX
22

33
Integrate HTMX with templates and views.
44

5-
The `bolt-htmx` Django package adds a couple of unique features for working with HTMX.
5+
The `bolt-htmx` package adds a couple of unique features for working with HTMX.
66
One is [template fragments](#template-fragments) and the other is [view actions](#view-actions).
77

88
The combination of these features lets you build HTMX-powered views that focus on server-side rendering and avoid overly complicated URL structures or REST APIs that you may not otherwise need.
@@ -41,14 +41,6 @@ you can use the `{% htmx_js %}` template tag:
4141

4242
## Installation
4343

44-
You can install `bolt-htmx` with any Django project:
45-
46-
```sh
47-
pip install bolt-htmx
48-
```
49-
50-
Then add `bolt.htmx` to `settings.py`:
51-
5244
```python
5345
INSTALLED_PACKAGES = [
5446
# ...
@@ -140,7 +132,7 @@ a standard `div` is output that looks like this:
140132
The `bolt-hx-fragment` is a custom attribute that we've added ("F" is for "Forge"),
141133
but the rest are standard HTMX attributes.
142134

143-
When Django renders the response to an HTMX request,
135+
When Bolt renders the response to an HTMX request,
144136
it will get the `Bolt-HX-Fragment` header,
145137
find the fragment with that name in the template,
146138
and render that for the response.
@@ -209,7 +201,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
209201

210202
# Action handling methods follow this format:
211203
# htmx_{method}_{action}
212-
def htmx_post_open(self, request, *args, **kwargs):
204+
def htmx_post_open(self):
213205
self.object = self.get_object()
214206

215207
if self.object.state != "closed":
@@ -223,7 +215,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
223215
context = self.get_context(object=self.object)
224216
return self.render_to_response(context)
225217

226-
def htmx_post_close(self, request, *args, **kwargs):
218+
def htmx_post_close(self):
227219
self.object = self.get_object()
228220

229221
if self.object.state != "open":
@@ -235,7 +227,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
235227
context = self.get_context(object=self.object)
236228
return self.render_to_response(context)
237229

238-
def htmx_post_merge(self, request, *args, **kwargs):
230+
def htmx_post_merge(self):
239231
self.object = self.get_object()
240232

241233
if self.object.state != "open":
@@ -263,7 +255,7 @@ class PullRequestDetailView(HTMXViewMixin, DetailView):
263255
return super().get_queryset().filter(users=self.request.user)
264256

265257
# You can also leave off the "bolt-hx-action" attribute and just handle the HTTP method
266-
def htmx_delete(self, request, *args, **kwargs):
258+
def htmx_delete(self):
267259
self.object = self.get_object()
268260

269261
self.object.delete()
@@ -338,7 +330,7 @@ urlpatterns = [
338330

339331
# views.py
340332
class PullRequestDetailView(HTMXViewMixin, DetailView):
341-
def htmx_post_update(self, request, *args, **kwargs):
333+
def htmx_post_update(self):
342334
self.object = self.get_object()
343335

344336
self.object.update()

0 commit comments

Comments
 (0)