Language Tree
Forms for creating and modifying language tree objects
Language Tree Node Form
- class integreat_cms.cms.forms.language_tree.language_tree_node_form.LanguageTreeNodeForm(**kwargs: Any)[source]
Bases:
CustomModelForm
,CustomTreeNodeForm
Form for creating and modifying language tree node objects
Form fields:
language
: Language (ModelChoiceField
)visible
: Visible (BooleanField
)active
: Active (BooleanField
)parent
: Source language (ModelChoiceField
)machine_translation_enabled
: Machine translatable (BooleanField
)_position
: Position (ChoiceField
)_ref_node_id
: Relative to (ChoiceField
)
- Parameters:
kwargs (Any)
- __init__(**kwargs: Any) None [source]
Initialize language tree node form
- Parameters:
**kwargs (Any) – The supplied keyword arguments
- Return type:
None
- clean() dict[str, Any] [source]
Validate form fields which depend on each other, see
django.forms.Form.clean()
: Don’t allow multiple root nodes for one region: If self is a root node and the region already has a default language, raise aValidationError
.
- property media[source]
Return all media required to render the widgets on this form.
- save(commit: bool = True) LanguageTreeNode [source]
This method extends the default
save()
-method of the baseModelForm
to flush the cache after committing.- Parameters:
commit (bool) – Whether or not the changes should be written to the database
- Returns:
The saved page translation object
- Return type: