jazzband / jazzband/django-model-utils

HistoryModel and status transition signals?

Open
#413 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
374
PR merge metrics
No merged PRs in 30d

Description

Hi!

I've discovered this package a little late, after we have implemented something similar for our projects. I would like to either release what we have to open source or perhaps make a pull request to this package to have the missing functionality.

1. We have something similar to the MonitorField, but actually a model that keeps a history of status changes, i.e. timestamp, old_status, new_status, user (who has done the change - from django_user middleware)

2. We have defined transition graph between statuses, i.e. draft can only go active or template but not to sold

```
TRANSITIONS = {
DRAFT: [ACTIVE, TEMPLATE],
ACTIVE: [SOLD, EXPIRED],
SOLD: [ACTIVE],
EXPIRED: [ACTIVE],
TEMPLATE: [ACTIVE]
}
```

3. We also have signals on transitions of the status, i.e. Order pending -> confirmed would send a signal to the notification handler (send push notification to the customer for example)

4. We use drf to ensure that the api gets display_name of the status, so that when you get the object status, it is not 0, 1, 2, 3, but draft, confirmed etc

Would this be something to integrate into this package?

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the package's existing MonitorField and the four requested capabilities: history records, transition validation, transition signals, and DRF status display names. Compare each request with the package's current scope; done would require a maintainer-approved, concrete feature scope rather than an implementation based on this open-ended proposal.

Written by the indexing model from the issue text.

Assessment

Tech stack
django, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.