Feedback
Forms for filtering feedback objects
Admin Feedback Filter Form
- class integreat_cms.cms.forms.feedback.admin_feedback_filter_form.AdminFeedbackFilterForm(**kwargs: Any)[source]
Bases:
RegionFeedbackFilterForm
Form for filtering admin (technical) feedback objects
Form fields:
language
: Language (ModelChoiceField
)category
: Category (ChoiceField
)read_status
: Status (MultipleChoiceField
)rating
: Rating (MultipleChoiceField
)date_from
: From (DateField
)date_to
: To (DateField
)query
: Query (CharField
)region
: Region (ModelChoiceField
)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None [source]
Initialize the custom filter form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- add_error(field, error)[source]
Update the content of self._errors.
The field argument is the name of the field to which the errors should be added. If it’s None, treat the errors as NON_FIELD_ERRORS.
The error argument can be a single error, a list of errors, or a dictionary that maps field names to lists of errors. An “error” can be either a simple string or an instance of ValidationError with its message attribute set and a “list or dictionary” can be an actual list or dict or an instance of ValidationError with its error_list or error_dict attribute set.
If error is a dictionary, the field argument must be None and errors will be added to the fields that correspond to the keys of the dictionary.
- add_initial_prefix(field_name)[source]
Add an ‘initial’ prefix for checking dynamic initial values.
- add_prefix(field_name)[source]
Return the field name with a prefix appended, if this Form has a prefix set.
Subclasses may wish to override.
- apply(feedback: CascadeDeletePolymorphicQuerySet) tuple[CascadeDeletePolymorphicQuerySet, None] [source]
Filter the feedback list according to the given filter data
- Parameters:
feedback (CascadeDeletePolymorphicQuerySet) – The list of feedback
- Returns:
The filtered feedback list and the search query
- Return type:
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property filters_visible: bool[source]
This function determines whether the filter form is visible by default.
- Returns:
Whether any filters (other than search) were changed
- get_initial_for_field(field, field_name)[source]
Return initial data for field on form. Use initial data from the form or the field, in that order. Evaluate callable values.
Return a list of all the BoundField objects that are hidden fields. Useful for manual form layout in templates.
- property is_enabled: bool[source]
This function determines whether the filters are applied.
- Returns:
Whether filtering should be performed
- is_multipart()[source]
Return True if the form needs to be multipart-encoded, i.e. it has FileInput, or False otherwise.
- non_field_errors()[source]
Return an ErrorList of errors that aren’t associated with a particular field – i.e., from Form.clean(). Return an empty ErrorList if there are none.
- order_fields(field_order)[source]
Rearrange the fields according to field_order.
field_order is a list of field names specifying the order. Append fields not included in the list in the default order for backward compatibility with subclasses not overriding field_order. If field_order is None, keep all fields in the order defined in the class. Ignore unknown fields in field_order to allow disabling fields in form subclasses without redefining ordering.
Region Feedback Filter Form
- class integreat_cms.cms.forms.feedback.region_feedback_filter_form.RegionFeedbackFilterForm(**kwargs: Any)[source]
Bases:
CustomFilterForm
Form for filtering feedback objects
Form fields:
language
: Language (ModelChoiceField
)category
: Category (ChoiceField
)read_status
: Status (MultipleChoiceField
)rating
: Rating (MultipleChoiceField
)date_from
: From (DateField
)date_to
: To (DateField
)query
: Query (CharField
)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None [source]
Initialize the custom filter form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- add_error(field, error)[source]
Update the content of self._errors.
The field argument is the name of the field to which the errors should be added. If it’s None, treat the errors as NON_FIELD_ERRORS.
The error argument can be a single error, a list of errors, or a dictionary that maps field names to lists of errors. An “error” can be either a simple string or an instance of ValidationError with its message attribute set and a “list or dictionary” can be an actual list or dict or an instance of ValidationError with its error_list or error_dict attribute set.
If error is a dictionary, the field argument must be None and errors will be added to the fields that correspond to the keys of the dictionary.
- add_initial_prefix(field_name)[source]
Add an ‘initial’ prefix for checking dynamic initial values.
- add_prefix(field_name)[source]
Return the field name with a prefix appended, if this Form has a prefix set.
Subclasses may wish to override.
- apply(feedback: CascadeDeletePolymorphicQuerySet) tuple[CascadeDeletePolymorphicQuerySet, None] [source]
Filter the feedback list according to the given filter data
- Parameters:
feedback (CascadeDeletePolymorphicQuerySet) – The list of feedback
- Returns:
The filtered feedback list and the search query
- Return type:
- clean()[source]
Hook for doing any extra form-wide cleaning after Field.clean() has been called on every field. Any ValidationError raised by this method will not be associated with a particular field; it will have a special-case association with the field named ‘__all__’.
- property filters_visible: bool[source]
This function determines whether the filter form is visible by default.
- Returns:
Whether any filters (other than search) were changed
- get_initial_for_field(field, field_name)[source]
Return initial data for field on form. Use initial data from the form or the field, in that order. Evaluate callable values.
Return a list of all the BoundField objects that are hidden fields. Useful for manual form layout in templates.
- property is_enabled: bool[source]
This function determines whether the filters are applied.
- Returns:
Whether filtering should be performed
- is_multipart()[source]
Return True if the form needs to be multipart-encoded, i.e. it has FileInput, or False otherwise.
- non_field_errors()[source]
Return an ErrorList of errors that aren’t associated with a particular field – i.e., from Form.clean(). Return an empty ErrorList if there are none.
- order_fields(field_order)[source]
Rearrange the fields according to field_order.
field_order is a list of field names specifying the order. Append fields not included in the list in the default order for backward compatibility with subclasses not overriding field_order. If field_order is None, keep all fields in the order defined in the class. Ignore unknown fields in field_order to allow disabling fields in form subclasses without redefining ordering.