On 10/15/06, chiangf <[EMAIL PROTECTED]> wrote:
>
Thanks a lot for all this notes, most of us have look at them too much
to find this kind of info :)

I'll try to answer your questions and give Mark some head starts :)

> >From a request of a friend that contributed code to TurboGears, I kept
> notes from when I started looking at TurboGears until I understood the
> basics.  Just a quick word about my background.  Most of my experience
> lies with Java and some Perl.  Before last week, I did not know
> anything about Python besides the name.  I browsed through Python
> basics using "Dive into Python"
> (http://diveintopython.org/toc/index.html) so I'm not claiming to be an
> expert or even to be familiar with Python
>
That's the best place to start when your a programer, even though it's
a great book you may want to take a look at
http://docs.python.org/tut/ it's more a tutorial for someone with less
programming background but covers some things that are usefull, and
it's great to learn some tricks.

> The following is the compilation of my notes:
>
>
> Setup
>
>     * was a little hard to determine which determine which file to
> download... the main page says   tgsetup.py, but windows installation
> page http://docs.turbogears.org/1.0/InstallWindows says ez_setup.py...
> i tried the former but it didnt quite work (probably because i did it
> wrong) so then i tried the latter method, which worked... a little
> confusing with two different methods
>
Actually they are both the same tgsetup.py is a nice script which goal
is to simplify instalation from 0. This is actually an issue with
setuptools which is a mix of cpan and jar files :) the next release of
it will be simplier to bootstrap.

One note about the tutorials, they where written in diferent stages of
the project so that's why you get some inconsistencies. the wiki (last
one) was written for 0.9 earlier alpha's, while the todolist was
written for 0.9a5 or a6, also the wiki was first written for 0.8 and
before that for 0.5 so some things where keep for backwards
compatiblitity

>
> Brian's TurboGears Tutorial (http://docs.turbogears.org/1.0/TodoList)
>
>     * when going through Brian's TurboGears Tutorial, i think it might
> be a little out of date, because during the first few steps, it asked
> me Do you need identity (username/passwords) in this project?", which
> was not covered in the tutorial
yes indeed this check of after the tutorial.

>     * for MySQL you need to set a length for email in the User class
> (dont know if this applies for SQLite)
umm I though SO/mysqldb will set a default length if none was specified.

>     * What's the difference between UnicodeCol and StringCol?
That's a big one. First of all you should undestand what Unicode is,
maybe a read of http://www.amk.ca/python/howto/unicode

Also SQLObject right now has some limitation on UnicodeCol, the last 2
at http://www.sqlobject.org/SQLObject.html#column-types refer to the
diferences in SQLObject types.

>     * "In addition, each user should have their own resource in the
> Userscontroller"... i had no idea what he meant by "resource" until i
> kept reading... i wish that what we were trying to do was explained
> briefly... also, it would be nice if the code was commented
need some refactoring there.

>     * I find it strange sometimes when after i make changes, the
> changes appear at localhost:8080 (the server automatically restarts
> after i save)... but then other times, even though it automatically
> restarts, i still need to manually shut down and then restart... im not
> sure if this is a consistent thing, but i noticed it for the template
> tutorial
Ummm could you explain exactly when this happens? it should restart
all the time, unless the change is in the templates since there is no
need to reboot the server for this. On the first request after the
change the template is check for changes and recompile.

>     * i also had no idea what templates were when i started
This is a common on web programming it's basically a set of text in a
domain specific languaje, it's goal is to keep MVC layers. there is
something similar in java on the java.text package, and if you have
program on java web (I'm sorry for that) you will see a lot of
templating engines there too. like http://jakarta.apache.org/velocity/

>     * i dont know if this is possible but having links to python docs
> for built-in functions would be nice because ppl (me) tend to forget
> things rather quickly what they do
let me show you a trick, there is this function call help in the
shell, so instead of going to the web you just write code :)
>>> help(str)
...  bunch of data.
it's very powerfull and you can pass in anything to it like.
>>> help([].append)
remenber that [] is an empty list and append it's it method this
should bring the docstring, also remenber not to call the function
help([].append()) becasue that will bring you back the help for
whatever it returns (in this case an error because append needs a
parameter (the value to append)

>     * while trying the form handling tutorial, i get the error
> TypeError: decoding Unicode is not supported... i fixed it with email =
> email.encode('utf-8')
that needs a fix.

>     * doesnt say what cherrypy.HTTPRedirect does and how does this
> differ from redirect() used in 20min screencast?
actually they are the same thing,
http://trac.turbogears.org/turbogears/browser/tags/1.0b1/turbogears/controllers.py#L517

this has several advantages
* redirect makes sure you get your URL right
* you can either call redirect as a function or raise it as an exception
* if TG eventually moves away from CP code wont break

so yes they should both say redirect() as that's the std right now.

>     * should have a link to mochikit docs... i had no idea where
> getElementsByTagAndClassName() came from until i found Mochikit docs
> myself

there is one at http://docs.turbogears.org/1.0/AlternativeComponents
but's its buried

I think we should add a section to http://docs.turbogears.org/1.0 with
the default components maybe even move this image to the frontpage
http://docs.turbogears.org/1.0/GettingStarted/BigPicture

>     * between editItem and saveItem, it would be better with more
> descriptions... it is not clear what field[0..2] is referring to
> anymore in saveItem, especially if one isnt quite thinking
>     * i dont think its clear where var showChanges = function(editBox,
> button, data) {...} gets its 3 parameters since its simply sent through
> like d.addCallback(showChanges, editBox, button);... in fact, even
> after reading mochikit docs, im still unsure but i think its because
> its chained
>     * at the end of Brian's tutorial, it mentioned advanced topics
> about TurboGears, which i wish was in another tutorial
>
there is a tutorial on identity http://docs.turbogears.org/1.0/IdentityManagment
and the one for widgets is comming soon :)
>
> 20min Screencast (http://docs.turbogears.org/1.0/Wiki20/Page1)
>
>     * while watching the screencast, i had no idea where publish_parts
> came from... after perusing and googling, it was still difficult to see
> a decent example... i learn best with examples, not descriptions...
> compared to java, java api has much more concrete examples than python
> docs... otherwise, python is definitely much more elegant and easy to
> learn
in the written version the first thing it asks you is to install the
package where it comes from, docutils. but yes this should be said on
the video.

>     * <div py:replace="XML(data)"> should have some explanation as to
> what XML does, or have a link that points to an API somewhere
http://kid-templating.org/language.html#xml-function

>     * in case people dont want to try it out themselves, it might be
> helpful to include screenshots or perhaps a working tutorial site of
> what the page would look like after each addition in the written 20-min
> wiki tutorial (because the screencast would take too long to see)...
> for example, after watching the screencast, i now look at the written
> tutorial, but i dont want to actually program it, so screenshots would
> have been useful for me
send them to me :)

>     * the written example explained a bit more of what publish_parts
> was but the explanation itself was difficult to find... also, it still
> doesnt explain exactly what it does and why we need it to grab html
> data from the database
yes that's true but remenber the idea of the wiki tutorial is to get
you hook in, not to be extensive, most TG apps don't even use
publish_parts this was just a clever way to get that bit out of the
way and focus on how great tg is.

>     * which reminds me... @expose was not explained in either
> tutorial... but i can guess what it does... still would be nice to be
> explained in detail though

well the idea is that you should guess what it is, but I agree an
explanation should be there somewhere, without going into it's
internals expose is a set of things, in it's most simply way that
means this method is exposed to the web using that template file.

>     * a finished source code available for download (controllers.py,
> models.py, templates, etc.) would have been useful for those that have
> watched the screencast and do not want to program it but still want to
> test it out
I believe that one was there. it probably got lots on the transition
to the new docs site. I have the old one on my disk (0.8a2 required :)
we'll need to upload the newest zip.

>     * the first tutorial did things somewhat differerently (im thinking
> of the redirects) than in this tutorial... im not sure what the
> difference is, if any... cherrpy.HTTPredirect vs. turbogears.redirect?
>
I explain this in the beginning
>
> Overall
>
>     * more explanation of the 3rd party functions (and perhaps links)
well this is part of TG idiology since we bring in things from other
places they have docs for it so there is no need to redothem.
>     * API needed... difficult to program without it
yes this is a big blocker there is one but it's old.

>     * include concrete examples and results (what the examples will
> produce) in the API, if possible, otherwise it will be as confusing as
> the 3rd party docs
maybe use doctest?

>     * screenshots
>     * inconsistencies between the two tutorials?  e.g. redirect
>     * i know that this isn't up to TurboGears, but web hosting options
> is really important to casual users such as myself as well as
> pricing... i know that i can get a PHP host for $5-7/month but a Python
> host are less popular and TurboGears hosts are even fewer in number and
> in order to sign up with WebFaction, I need to pay $4-5 more/month

One thing that you should note is that most php hostings out there are
bad so the actual number is not that different.

On the other hand python hosting is not something lots of companies do.

last but not least WebFaction service is great it's worth the money
even for non-tg projects.
>
>
>
> Continuing the last point in "Overall"... in the
> http://www.turbogears.org/docs/deployment/hosting.html page, under
> WestHost... it says that TurboGears can be run under "straight
> proxying".  What does that mean?
>
umm good question I don't know what's the westhost setup, my guess is
that they have an apache server that uses mod_proxy to send your CP
server the requests.
>
>
now let me ask you something

Did you like TG so far?

hope that helps

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to