This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpRequest, HttpResponse, QueryDict | |
class HttpVerbViewMiddleware: | |
"""Adds support for all HTTP verbs. | |
Notes | |
----- | |
Django uses request.GET and request.POST to store QueryDicts | |
of the request's URL parameters and body respectively. In an |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.utils.translation import gettext_lazy as _ | |
class FormMixin: | |
"""Adds extra classes and attributes to HTML widgets.""" | |
# This value will change with your CSS framework. | |
# https://missing.style/ | |
error_css_class = 'bad color' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HtmxPartialTemplateMiddleware: | |
"""Adds support for rendering partials with django-template-partials. | |
NOTES | |
----- | |
In order for this middleware to work properly, the following conditions must be met: | |
1) django-template-partials must be installed | |
2) Each template must have a partial defined directly in it with a name that coincides | |
with the HTML id of the element being swapped out. Since django-template-partials does |