>
> Now, i thought this would be easy but it has been harder than it seemed. 
> How can i define an array (of 15*50 for example) that accepts numeric 
> values, doesn't need to store them anywhere apart from that session, and 
> doesn't need to allow calculation with them as the spreadsheets i've seen? 
> I just want to define the website version of an numpy array!
>

My approach:

tools:

TABLE, FORM, INPUT, SELECT, OPTION

code:

# I assume only text input needed
table = TABLE(*[TR(*[TD(INPUT(_type="text",
                              _name="%s_%s" % (n, m))) for
              m in range(<m>)]) for r in range(<n>)])
form = FORM(SELECT(*[OPTION(<function to apply>) for
            f in <list of functions>], _name="function"), table)

if form.process().accepted:
    """Do calculations.
    The function name is retrieved with form.vars.function
    Form data is accesible with form.vars["%s_%s" % (n, m)]
    Then apply changes to form.vars values"""
    ...
return dict(form=form)

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to