Open blueyed opened 6 years ago
This wouldn't be hard but does django-fsm
actually send a field
kwarg? It's not documented here: https://github.com/kmmbvnr/django-fsm#signals
Also, since transitions always refer to a specific field, you can just do getattr(Model, transition)._django_fsm.field
to get to it later.
Currently the
field
keyword argument in the signal handler is not being handled.Therefore, if multiple state fields (e.g. "state" and "second_state") are being used those cannot be easily distinguished in the logs.
Do you think it makes sense to add "field_name" to
StateLog
, wherekwargs['field'].name
would be stored into?This could also be used in
__str__
then, but is typically redundant then (since often only a single state field is used probably).