State in django admin #9

Closed
thibault opened this Issue Feb 6, 2012 · 4 comments

2 participants

@thibault

Hi,

How can I handle an object state in the django admin?

All I can do is setting a 'choices' attribute in my field, to display a choice widget. However, it will not use the transitions methods.

How can I be sure to always use those methods?

Thanks.

@kmmbvnr
Owner

There is no way to do that. You can only set state field as readonly.

Usually state method have some parameters, so there is no possibility to provide some relable and generic implementation for calling it from admin,

@kmmbvnr kmmbvnr closed this Feb 6, 2012
@thibault

Thank you for your super-fast reply.

The thing is, my model state can be updated from many places: in a view, in my admin, in a management task, etc.

What I need it being able to process some code each time some model goes from state x to state y.

Would it be possible to run the translation method if it's available, rathar than setting the state directly?

@kmmbvnr
Owner

It is not the case for django_fsm purpose

@thibault

Ok, thank you for your replies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment