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
| 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 | str | Date format (e.g., YYYY-MM-DD, DD/MM/YYYY) | - | |
| time_format | str | Time format (e.g., HH:mm:ss, hh:mm A) | - | |
| language | str | Default language code (e.g., en, es, fr) | minLen: 2, maxLen: 10 | |
| 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 | - |
Permissions
| Role | Create | Delete | Read | Write |
|---|---|---|---|---|
| All | ✓ | |||
| System Manager | ✓ | ✓ |
Configuration
| Setting | Value |
|---|---|
| Submittable | False |
| Track Changes | True |
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