[Cubicweb] Workflows / vid statuschange
sylvain.thenault at logilab.fr
Fri Jun 11 15:08:06 CEST 2010
On 09 juin 10:20, Carlos Balderas wrote:
> Hello list!
> This question is about navigation among custom views.
> I was trying to call statuschange view (which is a form/view for changing
> states of a workflowable entity) from another place which is not the
> original entity primary view and I try to use __redirectpath form value to
> come back to the original place after validate or cancel button was
> executed, but did not work as I was expecting.
> I have been using __redirectpath form value to call "add" and "edition"
> views of entities from custum views I have made for my application to make
> certain way of custom navigation, I am not sure this is the correct thing to
> do to make this type of custom navigation, until now I haven't have any
> trouble at all though.
It's indeed the correct way to handle navigation after form posting.
> So, talking about statuschange vid, I was looking at method redirectpath in
> line 107 of cubicweb/web/views/workflow.py and I found that always writes
> the value of __redirectpath form variable, so I was thinking if you consider
> proper to make a validation when the __redirectpath is already present
> (sent) in the form parameters then respect the given value.
> I inherited the class ChangeStateFormView to make some tests about this, but
> I found out that this view always writes __redirectpath form parameter, so
> sending another __redirectpath parameter by GET form method will duplicate
> this value and I don't get the behavior I expected.
> Maybe exist another way to achive what I am looking for.
I'm not sure to grasp what are you trying to acheive your goal. Simply
overriding the redirectpath method to return whatever you want
doesn't do the trick?
Sylvain Thénault LOGILAB, Paris (France)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
CubicWeb, the semantic web framework: http://www.cubicweb.org
More information about the Cubicweb