from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, HTML, Submit from django import forms from django.contrib.auth.mixins import LoginRequiredMixin from django.urls import reverse_lazy from django.views.generic import UpdateView from YtManagerApp.models import UserSettings class SettingsForm(forms.ModelForm): class Meta: model = UserSettings exclude = ['user'] def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.helper = FormHelper() self.helper.form_class = 'form-horizontal' self.helper.label_class = 'col-lg-3' self.helper.field_class = 'col-lg-9' self.helper.layout = Layout( 'mark_deleted_as_watched', 'delete_watched', HTML('