mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-23 01:11:09 -05:00
feat: Refactor rides app with unique constraints, mixins, and enhanced documentation
- Added migration to convert unique_together constraints to UniqueConstraint for RideModel. - Introduced RideFormMixin for handling entity suggestions in ride forms. - Created comprehensive code standards documentation outlining formatting, docstring requirements, complexity guidelines, and testing requirements. - Established error handling guidelines with a structured exception hierarchy and best practices for API and view error handling. - Documented view pattern guidelines, emphasizing the use of CBVs, FBVs, and ViewSets with examples. - Implemented a benchmarking script for query performance analysis and optimization. - Developed security documentation detailing measures, configurations, and a security checklist. - Compiled a database optimization guide covering indexing strategies, query optimization patterns, and computed fields.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
{% load safe_html %}
|
||||
{# Security: Trigger and content are sanitized to allow only safe HTML elements. #}
|
||||
|
||||
<div class="relative inline-block text-left" x-data="{ open: false }" @click.away="open = false">
|
||||
<div @click="open = !open">
|
||||
{% if trigger %}
|
||||
{{ trigger|safe }}
|
||||
{{ trigger|sanitize }}
|
||||
{% else %}
|
||||
<button type="button"
|
||||
class="inline-flex w-full justify-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
|
||||
id="menu-button"
|
||||
aria-expanded="true"
|
||||
<button type="button"
|
||||
class="inline-flex w-full justify-center gap-x-1.5 rounded-md bg-white px-3 py-2 text-sm font-semibold text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 hover:bg-gray-50"
|
||||
id="menu-button"
|
||||
aria-expanded="true"
|
||||
aria-haspopup="true">
|
||||
{{ label|default:"Options" }}
|
||||
<svg class="w-5 h-5 -mr-1 text-gray-400" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
|
||||
@@ -29,7 +32,7 @@
|
||||
aria-labelledby="menu-button"
|
||||
tabindex="-1">
|
||||
<div class="py-1" role="none">
|
||||
{{ content|safe }}
|
||||
{{ content|sanitize }}
|
||||
{% block dropdown_content %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user