Adding Sections to Marketplace Categories
Information
Waldur marketplace categories can have sections (like "Support", "Security", "Location") that contain attributes (like "E-mail", "Phone", "Support portal"). These metadata fields appear when editing offerings under Public Information → Category in the UI.
- Categories created via
load_categoriescommand → Have sections automatically - Categories created manually via UI/API → No sections by default
Quick Start: Adding Support Section Example
Step 1: Check which categories need Support
Open Django shell:
1 | |
To see all categories without a Support section:
1 2 3 4 5 6 7 8 9 10 11 12 13 | |
Step 2: Define the helper function
Define the function to add Support section:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
Step 3: Use the function
Add Support section to your categories:
1 2 3 4 5 6 7 8 9 | |
What Gets Created
The Support section includes these attributes:
| Attribute | Type | Description |
|---|---|---|
| string | Support contact email | |
| Phone | string | Support phone number |
| Support portal | string | URL to support portal |
| Description | string | General support description |
Section Keys and Naming
Keys are automatically generated based on category title:
- Category:
"Applications"→ Section key:applications_Support - Category:
"Application Support"→ Section key:application_support_Support
Attribute keys follow the pattern: {section_key}_{attribute_name}
Example for "Applications" category:
applications_Support_emailapplications_Support_phoneapplications_Support_portalapplications_Support_description
Adding Other Sections
You can add other types of sections (Security, Location, etc.) using similar pattern.
Available Attribute Types
| Type | UI Element | Use Case |
|---|---|---|
string |
Text input | Short text (emails, names, URLs) |
text |
Textarea | Long text (descriptions) |
integer |
Number input | Numeric values |
boolean |
Checkbox | Yes/No values |
choice |
Dropdown | Single selection from list |
list |
Multi-select | Multiple selections from list |
Note: For choice and list types, you need to create AttributeOption objects:
Verification
After adding sections, verify in the UI:
- Log into Waldur
- Navigate to Marketplace → Offerings
- Edit an offering in the category you modified
- Go to Public Information → Category
- You should see the new section and attributes
Reference
For more examples, see the standard category definitions in:
src/waldur_mastermind/marketplace/management/commands/load_categories.py