Using django_fsm I need to get the available transitions a list. When using the following code I do get a <generator object get_available_FIELD_transitions at 0x10b9ba660>
obj = MyModel.objects.get(pk=object_id)
transitions = obj.get_available_status_transitions()
print(transitions)
Instead I would like to get a list of transitions like ['PENDING', 'CLOSED']
The generator has everything you need, it just needs iterating. To get what you want, you can just convert it to a list:
You might want to read up on generators in Python, they're very useful.