|
List Info
Thread: Handling Huge Forms?
|
|
| Handling Huge Forms? |

|
2006-11-18 08:13:02 |
Hi,
I use Cherrypy 2.1 and find it really helpful for most of my
work.
I've got a small doubt. In case, say a form has some 30 form
fields
(yes I am destined to work with such huge forms) then should
I pass all
the 30 fields as arguments to the form action function or is
there any
other way of calling a form action that does not need me to
call all
the fields (it is a pain typing in so many arguments to
the
function) but can get the work done.
Thanking in advance
Thejaswi
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Handling Huge Forms? |

|
2006-11-18 16:12:14 |
|
On 11/18/06, theju < thejaswi.puthraya gmail.com">thejaswi.puthraya gmail.com> wrote:
I use Cherrypy 2.1 and find it really helpful for most of my work. I've got a small doubt. In case, say a form has some 30 form fields (yes I am destined to work with such huge forms) then should I pass all the 30 fields as arguments to the form action function or is there any
other way of calling a form action that does not need me to call all the fields (it is a pain typing in so many arguments to the function) but can get the work done. Yo u can simply use Python's syntax for defining functions that support arbitrary keyword arguments. Here's a simple example...
expected_fields = ['foo', 'bar', 'baz', 'spam', 'eggs', 'herring']
class Something: cherrypy.expose def hugeformhandler(self, **kwargs): for each name in expected_fields: handlehuge(name,
kwargs.get(name, None))
def handlehuge(fieldname, value): # do whatever you want here... pass
See http://docs.python.org/tut/node6.html#SECTION006720000000000000000
for more info on the use of ** for arbitrary function keyword arguments.
Christian http://www.dowski.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "cherrypy-users" group. To post to this group, send email to cherrypy-users googlegroups.com To unsubscribe from this group, send email to cherrypy-users-unsubscribe googlegroups.com For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en -~----------~----~----~----~------~----~------~--~---
|
| Handling Huge Forms? |

|
2006-11-18 16:13:48 |
theju wrote:
> Hi,
> I use Cherrypy 2.1 and find it really helpful for most
of my work.
> I've got a small doubt. In case, say a form has some 30
form fields
> (yes I am destined to work with such huge forms) then
should I pass all
> the 30 fields as arguments to the form action function
or is there any
> other way of calling a form action that does not need
me to call all
> the fields (it is a pain typing in so many arguments
to the
> function) but can get the work done.
> Thanking in advance
> Thejaswi
>
Couldn't you just use **kw to capture the keyword arguments
as a
dictionary, and access them that way?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogsp
ot.com
Recent Ramblings http://del.icio.us/st
eve.holden
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-3]
|
|
|
about | contact Other archives ( Real Estate discussion Medical topics )
|