oioioi.base.forms

Module Contents

Classes

CustomCaptchaTextInput

Base class for Captcha widgets

RegistrationFormWithNames

Form for registering a new user account.

UserForm

The main implementation of all the Form logic. Note that this class is

OioioiUserForm

The main implementation of all the Form logic. Note that this class is

OioioiUserCreationForm

A form that creates a user, with no privileges, from the given username and

OioioiUserChangeForm

The main implementation of all the Form logic. Note that this class is

OioioiPasswordResetForm

A collection of Fields, plus their associated data.

AlwaysChangedModelForm

The main implementation of all the Form logic. Note that this class is

Functions

adjust_username_field(form)

adjust_name_fields(form)

adjust_unicode_field(form, field_name, help_text, ...)

get_consent(field_name, user)

_maybe_add_field(label, *args, **kwargs)

adjust_preferences_factory_fields()

handle_new_preference_fields(request, user)

save_consents(sender, user, **kwargs)

oioioi.base.forms.adjust_username_field(form)[source]
oioioi.base.forms.adjust_name_fields(form)[source]
oioioi.base.forms.adjust_unicode_field(form, field_name, help_text, invalid_message, unicode_categories=None, allow_spaces=True)[source]
oioioi.base.forms._maybe_add_field(label, *args, **kwargs)[source]
oioioi.base.forms.adjust_preferences_factory_fields()[source]
oioioi.base.forms.handle_new_preference_fields(request, user)[source]
oioioi.base.forms.save_consents(sender, user, **kwargs)[source]
class oioioi.base.forms.CustomCaptchaTextInput(attrs=None, field_template=None, id_prefix=None, generator=None, output_format=None)[source]

Bases: captcha.fields.CaptchaTextInput

Base class for Captcha widgets

template_name = captcha/custom_field.html[source]
class oioioi.base.forms.RegistrationFormWithNames(*args, **kwargs)[source]

Bases: registration.forms.RegistrationForm

Form for registering a new user account.

Validates that the requested username is not already in use, and requires the password to be entered twice to catch typos.

Subclasses should feel free to add any additional validation they need, but should avoid defining a save() method – the actual saving of collected user data is delegated to the active registration backend.

class Media[source]

Bases: object

js = ['js/refresh-simple-captcha.js'][source]
class oioioi.base.forms.UserForm(*args, **kwargs)[source]

Bases: django.forms.ModelForm

The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.

class Meta[source]

Bases: object

model[source]
fields = ['username', 'first_name', 'last_name', 'email'][source]
clean_username()[source]
save(*args, **kwargs)[source]

Save this form’s self.instance object if commit=True. Otherwise, add a save_m2m() method to the form which can be called after the instance is saved manually at a later time. Return the model instance.

class oioioi.base.forms.OioioiUserForm(*args, **kwargs)[source]

Bases: UserForm

The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.

class Media[source]

Bases: object

js = ['js/email-change.js'][source]
confirm_password[source]
clean_confirm_password()[source]
class oioioi.base.forms.OioioiUserCreationForm(*args, **kwargs)[source]

Bases: django.contrib.auth.forms.UserCreationForm

A form that creates a user, with no privileges, from the given username and password.

class oioioi.base.forms.OioioiUserChangeForm(*args, **kwargs)[source]

Bases: django.contrib.auth.forms.UserChangeForm

The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.

class oioioi.base.forms.OioioiPasswordResetForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Bases: django.contrib.auth.forms.PasswordResetForm

A collection of Fields, plus their associated data.

error_messages[source]
clean_email()[source]

Validates that an active user exists with the given email address.

class oioioi.base.forms.AlwaysChangedModelForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=ErrorList, label_suffix=None, empty_permitted=False, instance=None, use_required_attribute=None, renderer=None)[source]

Bases: django.forms.ModelForm

The main implementation of all the Form logic. Note that this class is different than Form. See the comments by the Form class for more info. Any improvements to the form API should be made to this class, not to the Form class.

has_changed()[source]

By always returning True even unchanged inlines will get saved.