How would the form definition "def form_input()" be altered (or would
it?) within the default.py to accommodate this scheme?



On Feb 28, 9:36 am, Alan Etkin <spame...@gmail.com> wrote:
> I assume you are using web2py to expose the form. Have you?
>
> If so, any data pickleable processed from the input can be stored and
> retrieved with de session object, which is available at any
> controller, model or view with each action:
>
> # store my input data
> session.my_input_data = <anything pickleable>
>
> # show my input data in a view
> {{ =H3("My input data") }}
> {{ =session.my_input_data }}
>
> On Feb 28, 10:16 am, Sam Flynn <flynns.arcade2...@gmail.com> wrote:
>
>
>
>
>
>
>
> > I'm trying to do a step process with data and having difficulty
> > figuring it out.  Any help MUCH appreciated!
>
> > I want to use a standard form such as input_form.html.  The input
> > values will be for values of w, x, y, z (e.g. W:
> > <input name="w" />).  From there I want to send the input values to
> > the following function to be classified:
>
> > class Scenario(object):
> >   def __init__(self, w, x, y, z):
> >     self.val = {}
> >     self.val['w'] = self.value(w,10,50)
> >     self.val['x'] = self.value(x,5,15)
> >     self.val['y'] = self.value(y,25,75)
> >     self.val['z'] = self.value(z,3,7)
> >   def value(self, v, l, u):
> >     if (v < l):
> >       return "low"
> >     if (u > v >= l ):
> >       return "med"
> >     if (v >= u):
> >       return "high"
> >   def __str__(self):
> >     return "scenario = (w: " + self.val['w'] + " x: " + self.val['x']
> > + " y: " + self.val['y'] + " z: " + self.val['z'] + ")"
>
> > This will return a scenario = w: w, x: x, y: y, z: z.
>
> > I'm looking to then match that scenario value against a table of the
> > 80 possible scenarios and retrieve an output for the matching scenario
> > in the table.  The output I would send back to the 'next' page from
> > the form along with a print of the scenario in question.
>
> > Again, any help on this greatly appreciated.  Once I see it once I'll
> > be able to get it.

Reply via email to