Forms
Forms for creating and modifying database objects.
Please refer to django.forms for general information about Django forms (see also: Working with forms).
Custom Model Form
- class integreat_compass.cms.forms.custom_model_form.CustomModelForm(**kwargs)
Bases:
ModelFormForm for populating all text widgets of a ModelForm with the default placeholder “Enter … here”. Use this form as base class instead of
django.forms.ModelForm.Form fields:
- __init__(**kwargs)
Initialize placeholder model form
- add_error_messages(request)
This function accepts the current request and adds the form’s error messages to the message queue of
django.contrib.messages.- Parameters:
request (HttpRequest) – The current request submitting the form
- clean()
This method extends the default
clean()-method of the baseModelFormto provide debug logging- Returns:
The cleaned data (see Overriding the clean() method)
- Return type:
- get_error_messages()
Return all error messages of this form and append labels to errors
- Returns:
The errors of this form
- Return type:
- property media
Return all media required to render the widgets on this form.
- save(commit=True)
This method extends the default
save()-method of the baseModelFormto provide debug logging- Parameters:
commit (bool) – Whether or not the changes should be written to the database
- Returns:
The saved object returned by The save() method
- Return type: