darryl@igor.penguinpowered.com wrote:
I am designing a site which will be used for a lot of data entry. I have zope 2.1.2 and mysql talking nicely. Now my problem is design.
I want the user to be able to fill in a form using some HTML select fields, these fields should then be translated into their respective item IDs for input into my table. So even though the user chooses:
cat dog mouse
the sql final method should be:
insert into table animals (cID, dID, mID) values (12, 14, 18)
In a CGI, I would use a python dictionary or perl hash to translate the keys into their values before makeing. But I'm a little stumped with zope? Should I handle this with an external method or can I do it with straight sql methods and built-ins?
You may want to look at my ZFormulator product. You could make a new field type in it that does this. You can also do it with external methods or even with DTML; you can do things like: REQUEST.set("cID", {'cat': 10, 'dog': 11}[cID]) before you pass REQUEST along to a zsql method. Regards, Martijn