A company can operate in several fields: industries become a per-person vocabulary, many per company #39
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Postulo/postulo#39
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Observation
What exists today
Company.industryis one free-text field of up to 120 characters (jobs/models.py, line 34). It is shown on the company page and in the companies table, searched by the table's box (jobs/views.py, line 52), exported (core/export.py, line 52), and filled byseed_demo. One string per company: a bank that is also an insurer and a software house gets whichever word the person typed first, and "Software, Insurance, Banking" typed into the one box is unsearchable as anything but a string.There is already a pattern for exactly this:
Tag(core/models.py, line 60) is an owner-scoped vocabulary — name, slug, colour, unique per owner — attached to applications through a many-to-many.Shape
1. An
Industrymodel, per person, many per company. Owner-scoped likeTag(name, slug, unique per owner), and a many-to-manyCompany.industries. Owner-scoped rather than shared because companies are owner-scoped by design — two people on one instance may describe the same employer differently, and neither should see the other's vocabulary.2. Entry. A tag-style input on the company form: type, pick from the person's existing industries, or create one on the spot. The same starter list is offered to everyone on an empty vocabulary — a few dozen broad fields in English, French and Portuguese (software, finance, insurance, health, education, public sector, energy, retail, manufacturing, media, non-profit…) — as suggestions, never as a closed list. A person who works in a niche types the niche.
3. Migration. Every existing
industrystring becomes oneIndustryrow for that owner (deduplicated by slug) linked to the company; the column is then dropped. Nothing is lost and nothing needs retyping.4. Everywhere the field was used:
;or,;seed_demogives its fictional companies two or three each.5. Optionally, a standard code beside the name. NACE Rev. 2 sections (the EU's classification, 21 sections A to U) or ISIC could be offered as an optional attribute of an industry, so that two people's "Software" and "IT" can be recognised as the same section in an aggregate. Not in the first cut: the free vocabulary is what people use; the code is a mapping to add when anyone asks for cross-instance comparability.
Classification
Enhancement. Not breaking: the migration converts every existing value, and the export format keeps accepting the old shape.
Open questions