use a table form renderer

This commit is contained in:
Oliver Zander 2025-08-20 14:28:46 +02:00 committed by Tobias Herre
parent 5696072604
commit 165ad050ad
2 changed files with 7 additions and 0 deletions

View File

@ -127,6 +127,8 @@ TIME_ZONE = env('TIME_ZONE', 'UTC')
STATIC_ROOT = BASE_DIR / 'staticfiles'
STATIC_URL = '/static/'
FORM_RENDERER = 'input.forms.TableFormRenderer'
if OAUTH_ENABLED := env('OAUTH_ENABLED', not DEBUG):
MIDDLEWARE += ['input.middleware.oauth.OAuthMiddleware']

View File

@ -1,6 +1,7 @@
from django.conf import settings
from django.forms import ModelForm, ChoiceField, RadioSelect, BooleanField
from django.contrib.admin.widgets import AdminDateWidget
from django.forms.renderers import DjangoTemplates
from django.utils.html import format_html
from django.utils.safestring import mark_safe
@ -22,6 +23,10 @@ from .models import (
)
class TableFormRenderer(DjangoTemplates):
form_template_name = 'django/forms/table.html'
class FdbForm(ModelForm):
'''this base class provides the required css class for all forms'''
required_css_class = 'required'