SystemSettings
System settings singleton DocType.
Stores global application configuration. Only one instance exists.
Attributes: name: Always "System Settings" app_name: Application display name timezone: Default timezone (e.g., "UTC", "America/New_York") date_format: Date format string (e.g., "YYYY-MM-DD") time_format: Time format string (e.g., "HH:mm:ss") language: Default language code (e.g., "en") enable_signup: Allow new user registration session_expiry: Session timeout in minutes maintenance_mode: If True, only admins can access
Example: settings = SystemSettings( app_name="My App", timezone="America/New_York", )Source: system_settings.py
Fields
Section titled “Fields”| Field | Type | Required | Description | Validators |
|---|---|---|---|---|
| name | str | Always ’System Settings | - | |
| app_name | str | Application display name | maxLen: 255 | |
| timezone | str | Default timezone (e.g., UTC, America/New_York) | - | |
| date_format | DateFormat | Date format (e.g., YYYY-MM-DD, DD/MM/YYYY) | - | |
| time_format | TimeFormat | Time format (e.g., HH:mm:ss, hh:mm A) | - | |
| language | str | Default language code (e.g., en, es, fr) | minLen: 2, maxLen: 10 | |
| supported_locales | list[str] | Supported locale codes for the deployment | - | |
| enable_signup | bool | Allow new user registration | - | |
| session_expiry | int | Session timeout in minutes | min: 1, max: 525600 | |
| maintenance_mode | bool | If True, only admins can access the application | - | |
| trash_retention_days | int | Days to retain soft-deleted documents before permanent cleanup | min: 1, max: 3650 | |
| landing_candidates | list[LandingCandidate] | Ordered list of landing candidates | - |
Permissions
Section titled “Permissions”| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| All | ✓ | |||
| System Manager | ✓ | ✓ |
Configuration
Section titled “Configuration”| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
Controller
Section titled “Controller”Controller hooks are implemented in *_controller.py files.
Available lifecycle hooks:
validate()- Called before save, raise exceptions for validation errorsbefore_insert()- Called before inserting a new documentafter_insert()- Called after successfully insertingbefore_save()- Called before saving (insert or update)after_save()- Called after savingbefore_delete()- Called before deletingafter_delete()- Called after deleting