django_webapps_fullstack.account.forms

This module provides comprehensive user authentication and account management forms for the dingx web application. It handles the complete user lifecycle from registration to password recovery, integrating with the Odoo ERP system via XMLRPC for centralized user data management.

Business Context:

The account app serves as the gateway for user interaction with the dingx platform, which provides a logistics management system for tracking and managing physical objects across different locations (storage, home, disposal, transfer). Users must authenticate through this system to access their personal dashboard and manage their belongings.

Key Business Processes:

  1. Authentication:

  • LoginForm: Secure login validation against Odoo user database
    • Session management for authenticated users

    • Credential retrieval for authorized access

  1. User Registration & Activation:

  • RegisterForm: New users register with name, email, login, and password
    • System validates uniqueness against Odoo database

    • Activation token sent via email to verify user identity

  • User_ActivateForm: Users must activate account before first login via email token

  1. Password Management:

Integration:

All forms communicate with the Odoo ERP backend via Twisted XMLRPC server, ensuring centralized user data management across the entire dingx ecosystem.

Classes

LoginForm(*args, **kwargs)

Create a form for the "login" template and create the functions of the form.

Password_ChangeForm(*args, **kwargs)

Create a form for the "password_change" template and create the corresponding functions of the form

Password_RecoveryForm(*args, **kwargs)

Create a form for the "recovery" template and create the corresponding functions of the form

Password_RenewForm(*args, **kwargs)

Create a form for the "password_renew" template and create the corresponding functions of the form

RegisterForm(*args, **kwargs)

Create a form for the "register" template and create the corresponding functions of the form.

ResetForm(*args, **kwargs)

Create a form and create the corresponding functions of the form

User_ActivateForm(*args, **kwargs)

Create a form and create the corresponding functions of the form

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

Bases: Form

Create a form for the “login” template and create the functions of the form.

base_fields = {}
clean()[source]

Check the credentials it gets and return a user object that matches those credentials if the credentials are valid. If they’re not valid, it return None.

declared_fields = {}
get_credentials(login)[source]

get the credentials of the account

property media

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

class django_webapps_fullstack.account.forms.Password_ChangeForm(*args, **kwargs)[source]

Bases: Form

Create a form for the “password_change” template and create the corresponding functions of the form

base_fields = {}
clean()[source]

Validation of the entered passwords.

declared_fields = {}
property media

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

save()[source]

Save the changed password in the Odoo Database.

class django_webapps_fullstack.account.forms.Password_RecoveryForm(*args, **kwargs)[source]

Bases: Form

Create a form for the “recovery” template and create the corresponding functions of the form

base_fields = {}
clean()[source]

Check if the email is valid.

create_resettoken()[source]

Create the password reset token und save it in the Odoo Database.

declared_fields = {}
property media

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

class django_webapps_fullstack.account.forms.Password_RenewForm(*args, **kwargs)[source]

Bases: Form

Create a form for the “password_renew” template and create the corresponding functions of the form

base_fields = {}
clean()[source]

Validation of the entered passwords.

declared_fields = {}
property media

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

save()[source]

Save the changed password in the Odoo Database.

class django_webapps_fullstack.account.forms.RegisterForm(*args, **kwargs)[source]

Bases: Form

Create a form for the “register” template and create the corresponding functions of the form.

base_fields = {}
clean()[source]

Validation of the entered values during the registration of a user.

create_activatetoken(login)[source]

Create the activate token for the user, which is used for the activation of the user account.

declared_fields = {}
property media

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

save(name, login, email, password)[source]

Save the user in the Odoo Database.

Returns:

(result, user_id, partner_id) from create_user function

Return type:

tuple

class django_webapps_fullstack.account.forms.ResetForm(*args, **kwargs)[source]

Bases: Form

Create a form and create the corresponding functions of the form

base_fields = {}
clean()[source]

Test if the provided reset token is correct.

declared_fields = {}
property media

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

save()[source]

Update of the provided reset token so that the token could be used any longer.

class django_webapps_fullstack.account.forms.User_ActivateForm(*args, **kwargs)[source]

Bases: Form

Create a form and create the corresponding functions of the form

base_fields = {}
clean()[source]

Test if the provided activate token is correct.

declared_fields = {}
property media

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

save()[source]

Update of the provided activate token so that the user account could be used.