Add Entry Type taxonomy to entries and reports - #21
Merged
Merged
Conversation
Add a new extensible "Entry Type" taxonomy table (Weekly Report, Milestone, Activity seeded) so submissions can be classified by type. Entry Type is optional on WorkItem (like Group), so existing entries need no backfill. - taxonomy: new EntryType(TaxonomyBase) + migration, admin registration, management views/URLs/templates, "Entry Types" nav tab on all taxonomy pages, JSON export/import, and seed_taxonomy entries. - entries: nullable entry_type FK + index, form dropdown, detail display, admin list/filter. - reports: Entry Type filter on the report page (filter-only, matching the Lab Priority pattern). - audit: track entry_type_id changes. - docs: API page lists the new /taxonomy/entry-types/ routes. - tests: form save + optional, management page access + create, seed count, reports filter (204 passing). Closes #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces an optional Entry Type taxonomy to classify entries and enable filtering in reports, implemented in the same “extensible taxonomy” style as Projects/Categories so it can be managed by admins without code changes.
Changes:
- Adds
EntryTypetaxonomy model (with migration), admin registration, management views/URLs, templates, and export/import +seed_taxonomydefaults. - Adds nullable
WorkItem.entry_typeFK (with index), exposes it on entry create/edit + detail views, and adds it to the entries admin list/filter. - Adds an Entry Type filter to the Reports page and includes tests covering management access/creation, entry form behavior, seeding, and reports filtering.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_taxonomy.py | Adds coverage for Entry Type management access/creation and seed expectations. |
| tests/test_reports.py | Adds report preview filtering test for entry_type. |
| tests/test_entries.py | Adds form submission tests ensuring entry_type is saved and optional. |
| apps/taxonomy/views.py | Adds Entry Type manage/edit views and includes entry types in taxonomy export/import. |
| apps/taxonomy/urls.py | Adds routes for Entry Type manage/edit pages. |
| apps/taxonomy/templates/taxonomy/projects.html | Adds “Entry Types” tab link in taxonomy navigation. |
| apps/taxonomy/templates/taxonomy/lab_priorities.html | Adds “Entry Types” tab link in taxonomy navigation. |
| apps/taxonomy/templates/taxonomy/groups.html | Adds “Entry Types” tab link in taxonomy navigation. |
| apps/taxonomy/templates/taxonomy/categories.html | Adds “Entry Types” tab link in taxonomy navigation. |
| apps/taxonomy/templates/taxonomy/entry_types.html | New Entry Types management page (list/add + JSON restore toggle). |
| apps/taxonomy/templates/taxonomy/entry_type_form.html | New Entry Type edit form page. |
| apps/taxonomy/models.py | Introduces EntryType(TaxonomyBase). |
| apps/taxonomy/migrations/0004_entrytype.py | Creates EntryType table. |
| apps/taxonomy/management/commands/seed_taxonomy.py | Seeds default Entry Types (Weekly Report/Milestone/Activity). |
| apps/taxonomy/forms.py | Adds EntryTypeForm. |
| apps/taxonomy/admin.py | Registers EntryType in Django admin. |
| apps/reports/templates/reports/index.html | Adds Entry Type dropdown filter to the Reports page. |
| apps/reports/filters.py | Adds entry_type ModelChoiceFilter to WorkItemFilter. |
| apps/entries/templates/entries/form.html | Adds Entry Type dropdown to entry create/edit form. |
| apps/entries/templates/entries/detail.html | Displays Entry Type on entry detail page when present. |
| apps/entries/models.py | Adds nullable entry_type FK on WorkItem plus index. |
| apps/entries/migrations/0008_workitem_entry_type_and_more.py | Migration adding entry_type field and DB index. |
| apps/entries/forms.py | Adds entry_type to WorkItemForm fields and queryset. |
| apps/entries/admin.py | Adds entry_type to admin list display and filters. |
| apps/core/templates/core/api.html | Documents the new /taxonomy/entry-types/ routes. |
| apps/audit/signals.py | Tracks entry_type_id changes in audit logging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new Entry Type classification for submissions, addressing #16.
Entry Type is modeled as an extensible taxonomy table (like Project/Category) so admins can add/sort/deactivate types without code changes. It is optional on entries (like Group), so existing entries need no backfill. Category is kept as-is.
Changes
EntryType(TaxonomyBase)+ migration; Django admin registration; management views/URLs/templates; "Entry Types" tab on every taxonomy page; JSON export/import;seed_taxonomyseeds Weekly Report / Milestone / Activity.entry_typeFK (+ index); dropdown on the new/edit entry form; shown on the detail page; added to the entries admin list/filter.entry_type_idchanges./taxonomy/entry-types/routes.Out of scope (follow-up if wanted)
entry_type.Closes #16
🤖 Generated with Claude Code