Branko - it would've been easier to write a more inclusive tutorial :-D

I really appreciate the effort George - takes a lot of courage to post on
this forum. i hope you won't quit trying :)

-----------------------
Visit My Sites!
www.syrbot.com | My Site
www.attackr.com | Latest Blog Posts
www.superantispyware.com/superantispyware.html?rid=3971 Remove All The
Spyware - Not Just The Easy Ones!



On Mon, Mar 1, 2010 at 3:55 AM, Branko Vukelic <[email protected]> wrote:

> On Mon, Mar 1, 2010 at 4:52 AM, George Oliver <[email protected]>
> wrote:
> > hi, as a beginner with Python, JavaScript, and webpy I've attempted to
> > write a brief introduction to combining these things, for someone at a
> > similar level as myself. What would be great though is if someone
> > could run an experienced eye over it for any glaring errors. The link
> > is:
> >
> >
> http://kooneiform.wordpress.com/2010/02/28/python-and-ajax-for-beginners-with-webpy-and-jquery/
> >
> > As it took some legwork to integrate this information into one spot,
> > I'm hoping other beginners can make use of it.
>
> First of all, it's very useful material. People keep asking about AJAX
> in this group, so it's a good thing we can refer them to your article.
>
> Now, the criticism. :) Maybe I'm nitpicking a bit here, but:
>
> 1. web.py not webpy
>
> 2. it's weird that you call your app file server.py. Someone might get
> an impression you're writing a customized stand-alone server of some
> sort. You might call the file app.py or code.py (I prefer the first
> one, because it's self-evident), or my_project_name.py.
>
> 3. We don't override the GET and POST methods. We just write them. The
> classes such as your ``project`` class are not subclasses of anything,
> so there is no override.
>
> 4. It's a bit weird that you create a separate form for just the
> submit button, although it's not illegal or anything. Just a bit off.
> Just finished reading the whole article, and I still don't see any
> reason why your button can't be in the same form as the text box. I
> usually hard-code the submit button in my template because I might
> want to change it depending on some factors (like show "preview", and
> once that is clicked, change it to "submit", and add "continue
> editing").
>
> 5. Overriding built-in keywords like ``input`` is not a good thing
> (http://docs.python.org/library/functions.html#input). You should have
> used another variable name for the ``input``. You can see even in your
> code highlighting that input is a 'reserved' word. Of course, it's not
> illegal, and it works. It's just that you loose the built-in input if
> you do that.
>
> 6. "It’s important to define a copy of the form elements (I’m not
> totally clear why this is so in webpy;" You don't really create a copy
> of the form elements. You just call the form class instance, and it
> makes the copy of itself for you. If you supply arguments to the call,
> it also does validation. For beginners, though, I think this is not
> important at all, actually.
>
> 7. In ``POST``, you should supply the default value to
> ``web.input()``, like ``web.input(input='some value')``, so that your
> code doesn't fail. You can't just assume that the POST request comes
> from the page you served.
>
> 8. If you're using forms, you can also access data submitted by the
> form using the form instance. And that is a better way to do things,
> especially if you take time to write validation routines for your
> form. It also auto-extracts code from the web.input() for you.
>
> 9. "An additional note about $ is that you need to use $: if the
> expression will contain some HTML that you don’t want escaped." You
> should move this to the part where you're actually using it (rendering
> form elements).
>
> 10. To prevent a user for sending multiple AJAX requests, simply
> disable the button on click, and enable it when request is finished
> and data loaded.
>
> Regards,
>
>
> --
> Branko Vukelić
>
> http://foxbunny.tumblr.com/
> http://www.flickr.com/photos/16889...@n04/
> http://www.twitter.com/foxbunny
> http://github.com/foxbunny
>
> --
> You received this message because you are subscribed to the Google Groups
> "web.py" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected] <webpy%[email protected]>.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to