Hello,

I have a question for users of "forms" (http://forms- project.pollenation.net).
I'm looking for a way to do something like this:

class UserAdd(forms.ResourceMixin, rend.Page):

    def __init__(self, user, step=1, *a, **k):
        apply(forms.ResourceMixin.__init__, (self, user) + a, k)
        self.user = user
        self.step = step

    def form_edit(self, ctx):
        [...]

        form.addAction(submit)
        return form

    def formSubmitted(self ,ctx, form, data):
       print form, data
       return UserAdd('myuser', self.step)

I want to render form, depend on "self.step" (i want have a few form steps on my site).
In contruction like above on action submit i have neverending loop.

thanks, for any advice

PS. I simply want to have an effect like in "testformless.py" (from nevow examples):
"""
class NameWizard(rend.Page):
docFactory = loaders.stan(tags.html[tags.h1["What is your name"], webform.renderForms()])

    def bind_name(self, ctx):
        return [('name', annotate.String())]

    def name(self, name):
        return QuestWizard(name)


class QuestWizard(rend.Page):
docFactory = loaders.stan(tags.html[tags.h1["What is your quest"], webform.renderForms()])

    def bind_quest(self, ctx):
return [('quest', annotate.Choice(['Find the Grail', 'Get laid', 'Earn twenty bucks', 'Destroy the sun']))]

    def quest(self, quest):
        return FinalWizard((self.original, quest))
"""

--
qk


_______________________________________________
Twisted-web mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web

Reply via email to