Skip to content

Add Entry Type taxonomy to entries and reports - #21

Merged
normanajn merged 1 commit into
mainfrom
feature/entry-type
Jun 25, 2026
Merged

normanajn merged 1 commit into
mainfrom
feature/entry-type

Conversation

@normanajn

Copy link
Copy Markdown
Collaborator

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

  • taxonomy: new EntryType(TaxonomyBase) + migration; Django admin registration; management views/URLs/templates; "Entry Types" tab on every taxonomy page; JSON export/import; seed_taxonomy seeds Weekly Report / Milestone / Activity.
  • entries: nullable entry_type FK (+ index); dropdown on the new/edit entry form; shown on the detail page; added to the entries admin list/filter.
  • reports: Entry Type filter on the Reports page (filter-only, matching the existing Lab Priority pattern — no new sortable column).
  • audit: tracks entry_type_id changes.
  • docs: API page lists the new /taxonomy/entry-types/ routes.
  • tests: form save + optional behavior, management page access + create, seed count, reports filter. Full suite: 204 passing.

Out of scope (follow-up if wanted)

  • Report exporters (CSV/Excel/PDF/AI) and the JSON entry API do not yet include entry_type.

Closes #16

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings June 25, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EntryType taxonomy model (with migration), admin registration, management views/URLs, templates, and export/import + seed_taxonomy defaults.
  • Adds nullable WorkItem.entry_type FK (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.

@normanajn
normanajn merged commit fcb4507 into main Jun 25, 2026
1 check passed
@normanajn
normanajn deleted the feature/entry-type branch June 25, 2026 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Report Type" menu

2 participants