You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Admin actions fail to execute correctly when run from the state object list view.
Im not able to tell how to fix this or Id be posting a pull request. But either its broken in 1.5 or we need some more documentation on how to use the admin functions so i can see where I went wrong implementing this.
I've followed the instructions as far as settign up the admin.py goes, heres the reveleant portions from my admin.py
This is the section of machine.py that is breaking and driving me nuts. Ive spent 3 days going over this section of code trying to work out what I have done wrong or what is broken.
@classmethoddefget_admin_actions(cls, field_name='state'):
""" Creates a list of actions for use in the Django Admin. """actions= []
defcreate_action(transition_name):
defaction(modeladmin, request, queryset):
# Dry run firstforoinqueryset:
get_STATE_info=getattr(o, 'get_%s_info'%field_name)
try:
get_STATE_info.test_transition(transition_name, request.user)
exceptTransitionException, e:
modeladmin.message_user(request, 'ERROR: %s on: %s'% (e.message, unicode(o)))
return# Make actual transitionsforoinqueryset:
get_STATE_info=getattr(o, 'get_%s_info'%field_name)
get_STATE_info.make_transition(transition_name, request.user)
# Feebackmodeladmin.message_user(request, 'State changed for %s objects.'%len(queryset))
action.short_description=unicode(cls.transitions[transition_name])
action.__name__='state_transition_%s'%transition_namereturnactionfortincls.transitions.keys():
actions.append(create_action(t))
returnactions
When I set some pdb breakpoints and walk through the sequence of events when trying to perform an admin action i get the following chain of events. It starts with the line
foroinqueryset:
after the comment "# Dry run first"
I step down through the execution and test repeatedly at each stage for the ability to perform *var.test_transition on any variables at that level of the stack. Then after reaching the line that causes the stack dump I step the debugger through a few more lines of generic django 1.5 code before telling the debugger to continue which as it has passed through all my set breakpoints, causes it to execute & print out the Traceback you see at the end of the PDB session.
Admin actions fail to execute correctly when run from the state object list view.
Im not able to tell how to fix this or Id be posting a pull request. But either its broken in 1.5 or we need some more documentation on how to use the admin functions so i can see where I went wrong implementing this.
I've followed the instructions as far as settign up the admin.py goes, heres the reveleant portions from my admin.py
This is the section of machine.py that is breaking and driving me nuts. Ive spent 3 days going over this section of code trying to work out what I have done wrong or what is broken.
When I set some pdb breakpoints and walk through the sequence of events when trying to perform an admin action i get the following chain of events. It starts with the line
after the comment "# Dry run first"
I step down through the execution and test repeatedly at each stage for the ability to perform *var.test_transition on any variables at that level of the stack. Then after reaching the line that causes the stack dump I step the debugger through a few more lines of generic django 1.5 code before telling the debugger to continue which as it has passed through all my set breakpoints, causes it to execute & print out the Traceback you see at the end of the PDB session.
The text was updated successfully, but these errors were encountered: