2023-12-13 23:58:00 +01:00
|
|
|
from i18nfield.forms import I18nModelForm
|
|
|
|
|
|
|
|
from .models import MusicrateSettings
|
|
|
|
|
|
|
|
|
|
|
|
class MusicrateSettingsForm(I18nModelForm):
|
|
|
|
def __init__(self, *args, event=None, **kwargs):
|
|
|
|
self.instance, _ = MusicrateSettings.objects.get_or_create(event=event)
|
|
|
|
super().__init__(*args, **kwargs, instance=self.instance, locales=event.locales)
|
|
|
|
|
|
|
|
class Meta:
|
|
|
|
model = MusicrateSettings
|
2023-12-14 00:57:15 +01:00
|
|
|
fields = ("some_setting",)
|
2023-12-13 23:58:00 +01:00
|
|
|
widgets = {}
|