Actually, the form is not displayed on every request and is embedded in a 
function. When I have the time, I will be moving it to modules, not a 
controller. I am basically using the automatic form generation capabilities 
of web2py without the self-submitting capabilities. I override all the form 
actions with on_click events. I originally had this coded as raw html, but 
then decided it would be easier to maintain if I got SQLFORM to do the work 
for me. In the final analysis, it's almost a tie in terms of conciseness. 
What I do like about the SQLFORM approach is that it self-documents exactly 
which table in the DAL is going to get updated.

On Monday, July 30, 2012 6:35:33 AM UTC+8, howesc wrote:
>
> i might also ask if that form is displayed on *every* request.  if not, i 
> would recommend moving it from the model file to the controller where it is 
> used (or a module if it is used in several controllers).
>
> On Sunday, July 29, 2012 7:25:55 AM UTC-7, weheh wrote:
>>
>> Massimo, thanks for pointing out the obvious to me. I knew it had to be 
>> something that simple, just couldn't see it. I had decided to use factory 
>> instead of pure SQLFORM because I'm not going through the usual self-submit 
>> process. The db is all manipulated via ajax in this case and the form is a 
>> convenient way to get the widgets I need.
>>
>> Thanks for the suggestions for the autocomplete widget and cache. 
>> Instead, since I don't need the reference in my form, I'm just turning it 
>> off altogether with readable/writable = False. After making the change, the 
>> time to build the form dropped to 0.04 sec. Now, that's more like it!
>>
>>

-- 



Reply via email to