Renamed the form property to form_class in the Mia core application.
This commit is contained in:
parent
de924efda0
commit
a2a47cdea2
@ -985,7 +985,7 @@ class AccountView(DetailView):
|
|||||||
class AccountFormView(FormView):
|
class AccountFormView(FormView):
|
||||||
"""The form to create or update an account."""
|
"""The form to create or update an account."""
|
||||||
model = Account
|
model = Account
|
||||||
form = AccountForm
|
form_class = AccountForm
|
||||||
not_modified_message = gettext_noop("This account was not modified.")
|
not_modified_message = gettext_noop("This account was not modified.")
|
||||||
success_message = gettext_noop("This account was saved successfully.")
|
success_message = gettext_noop("This account was saved successfully.")
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ from .utils import UrlBuilder
|
|||||||
class FormView(View):
|
class FormView(View):
|
||||||
"""The base form view."""
|
"""The base form view."""
|
||||||
model: Type[Model] = None
|
model: Type[Model] = None
|
||||||
form: Type[forms.Form] = None
|
form_class: Type[forms.Form] = None
|
||||||
template_name: str = None
|
template_name: str = None
|
||||||
context_object_name: str = "form"
|
context_object_name: str = "form"
|
||||||
success_url: str = None
|
success_url: str = None
|
||||||
@ -106,9 +106,9 @@ class FormView(View):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def _form(self):
|
def _form(self):
|
||||||
if self.form is None:
|
if self.form_class is None:
|
||||||
raise AttributeError("Please defined the form property.")
|
raise AttributeError("Please defined the form_class property.")
|
||||||
return self.form
|
return self.form_class
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _model(self):
|
def _model(self):
|
||||||
@ -236,7 +236,7 @@ class UserView(DetailView):
|
|||||||
class UserFormView(FormView):
|
class UserFormView(FormView):
|
||||||
"""The form to create or update a user."""
|
"""The form to create or update a user."""
|
||||||
model = User
|
model = User
|
||||||
form = UserForm
|
form_class = UserForm
|
||||||
not_modified_message = gettext_noop("This user account was not changed.")
|
not_modified_message = gettext_noop("This user account was not changed.")
|
||||||
success_message = gettext_noop("This user account was saved successfully.")
|
success_message = gettext_noop("This user account was saved successfully.")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user