jacobh / drf-fsm-transitions

Automatically hook your Django-FSM transitions up to Django REST Framework
MIT License
28 stars 14 forks source link

Pass request to transition method #11

Open ydaniv opened 8 years ago

alexdutton commented 8 years ago

django-fsm transition methods aren't necessarily designed to be called from a request, so I'm not sure this is a good idea. My pull in #10 would let you provide a method on the viewset to construct the arguments that are to be passed to the transition method.

ydaniv commented 8 years ago

This is not django-fsm, this is drf-fsm-transitions, and DRF stands for the API part. So what can I do with an API endpoint if I can't get the request?!?

alexdutton commented 8 years ago

Because you don't always want to trigger a transition from a request (e.g. maybe from a celerybeat task), and you should be explicit about the bits of the request you want to use (easier to understand what it's doing, easier to test, can't start requiring other bits of the request without being explicit about it).