Skip to main content
Extend this class to add custom user fields to registered users in pyconfigs/user.py. The derived class must also be named CustomUserFields. This class can be imported from the squirrels.auth or the squirrels module.

Example

from squirrels import auth

class CustomUserFields(auth.CustomUserFields):
    department: str = "general"
    employee_id: int | None = None
Always set a default value for each custom field. Use None if default is null.Failure to do so will result in a validation error.

Supported field types

Each new field in the derived class must be of one of the following types:
  • str - String values
  • int - Integer values
  • float - Float values
  • bool - Boolean values
  • typing.Literal - Literal types
Add | None after the type to make it nullable.