Forms

class cruditor.forms.CruditorTapeformMixin(*args, **kwargs)[source]

Bases: Bootstrap4TapeformMixin

Cruditor mixin for all forms (relies on django-tapeforms).

class cruditor.forms.CruditorFormsetMixin[source]

Bases: object

Helper mixin to provide some additional configuration to the javascript part of Cruditor’s formset support, mainly translations but also all other stuff which might be needed.

js_formset_options = None[source]
template_context[source]

This cached property can be used to access extra context in the formset template while keeping the performance up by not “generating” the context over and over again. The return value of this property is generated by calling the method get_template_context once per formset instance.

get_template_context()[source]

This method builds a context which is used by the template_context property to return additional context when rendering the formset. Some defaults are already set and might be overwritten.

add_fields(form, index)[source]

Overwritten method to make sure the DELETE marker field is hidden in output.

get_js_formset_options()[source]

This method builds the options dict for the javascript part. Some defaults are merged with js_formset_options property.

class cruditor.forms.CruditorFormsetFormMixin(*args, **kwargs)[source]

Bases: CruditorTapeformMixin

Helper mixin for forms in a formset, used together with Cruditor-enabled formsets.

visible_fields()[source]

This method is overwritten to make sure that the DELETE marker field is not considered when returning the list of visible fields.

hidden_fields()[source]

This method is overwritten to make sure that the DELETE marker field is not considered when returning the list of hidden fields. Cruditor template renders the field manually.

class cruditor.forms.LoginForm(*args, **kwargs)[source]

Bases: CruditorTapeformMixin, AuthenticationForm

Tapeform-enabled version of the Django AuthenticationForm.

base_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}[source]
declared_fields = {'password': <django.forms.fields.CharField object>, 'username': <django.contrib.auth.forms.UsernameField object>}[source]
property media[source]

Return all media required to render the widgets on this form.

class cruditor.forms.ChangePasswordForm(*args, **kwargs)[source]

Bases: CruditorTapeformMixin, SetPasswordForm

Tapeform-enabled version of the Django SetPasswordForm.

base_fields = {'new_password1': <django.forms.fields.CharField object>, 'new_password2': <django.forms.fields.CharField object>}[source]
declared_fields = {'new_password1': <django.forms.fields.CharField object>, 'new_password2': <django.forms.fields.CharField object>}[source]
property media[source]

Return all media required to render the widgets on this form.