On Mon, May 4, 2009 at 11:31 AM, dlypka <dly...@gmail.com> wrote: > > Hi: > > Thank you for this, but I am still not clear on what to code > W
..... > hy does the controller have > def data: return dict(form=crud()) when the variable 'form' would not > be used in the View, since a custom view is to be used instead? > i.e. could we just write > def data: return dict(=crud()) ?? > > sounds like you need to see this, visualize this: use the shell: python web2py.py -S myapp -M >>> # don't worry about passing to a view - see what happens: >>> form=crud() >>> # now the view has a variable "form" - what does it contain? >>> print form >>> type( form ) >>> dict( form ) I hope you're getting the idea. You could also grab a copy of WingIDE form www.wingware.com - I haven't used to free "101" version, but I think you can inspect local variables the same way - so to do this there, set a breakpoint, in your function, separate the assignment from the return (so it is easier to inspect little by little what is going on), e.g.: def my_controller_function: # ... stuff.... form=crud() # now you can stop and inspect all the elements of this send_to_view = dict( form ) return send_to_view See if that helps you... --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---