On Wednesday, March 23, 2016 at 3:01:24 PM UTC-7, Literate Aspects wrote:
>
> Hi Rimas,
>
> I thank you for the kind thoughts, but I simply don't have that luxury.  I 
> read and I listen to the video tutorials, IF they matched the current live 
> app, then following the step by step instructions would be straight 
> forward, but the live app does not match the instructions, so at each step, 
> one has to FIGURE out an unknown.
>
>
The only difference I recognized in the screen shots was that the book had 
1 more line in the header comment.  The code lines you showed seemed to 
match.  But recognize that the code included in the Welcome app (which is 
the code that gets used if you pressed the "Make new App" button on the 
Web2Py "console" page) can get changed every release; the book tends not to 
change as often.

Some of these changes are simplification, some are taking advantage of new 
features, and some are corrections.

Going back to one of your earlier questions:

def index(): return "Hello from MyApp"

differs from 

def index(): return dict(message="Hello from MyApp")

in a basic Python way ... the first returns a string, the second returns a 
dictionary object, where the key "message" has the value "Hello from 
MyApp:, which is a string.  The generic views that come with Web2Py know 
how to render a string.  They also know how to render values retrieved from 
a dictionary.  Just about everything else is a special case of those 2 
basic capabilities.

The BEAUTIFY() helper Rimas mentioned is something that gets executed on 
the server (in rendering the views) to generate HTML that shows what's in 
the object given as it's argument.  If that argument is a dictionary like 
the above, it will render a short table showing the key ("message") and its 
value ("Hello From MyApp").

Chapter 2 covers some Python basics, and general Python tutorials and books 
are available elsewhere.  If you're totally new to programming, than you 
may want to spend some time on those.  If you're used to C or C# or Java, 
Chapter 2 may be enough to get you started.

Good luck!

/dps



-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to