2 messages in com.googlegroups.pylons-discussRe: A few question about "Making a Py...| From | Sent On | Attachments |
|---|---|---|
| John Smith | 16 Feb 2008 05:28 | |
| Mike Orr | 18 Feb 2008 19:41 |
| Subject: | Re: A few question about "Making a Pylons Blog" tutorial![]() |
|---|---|
| From: | Mike Orr (slug...@public.gmane.org) |
| Date: | 02/18/2008 07:41:01 PM |
| List: | com.googlegroups.pylons-discuss |
On Feb 16, 2008 5:29 AM, John Smith
<ebgs...@public.gmane.org> wrote:
* Step 1.3 - Models and Data ** Typo? "Put this in the "[app:man]" section." should be "Put this in the "[app:main]" section."
Typo. Fixed.
** Unicode "Because databases cannot store Unicode directly, the "sqlalchemy.convert_unicode" option makes SQLAlchemy convert String columns to UTF-8 on write, and back to Unicode on read. Otherwise you'd get "str" strings containing whatever's in the database verbatim. (This is preferred over MySQL's "?use_unicode=1" option because it's database neutral.)"
I think the word "Unicode" here means probably UTF-16, Python's internal encoding. The sentence "databases cannot store Unicode directly..." made me wornder, thinking "What? RDBMSs I know all support Unicode!" IMHO, this part could be clearer by explicitly distinguishing python's unicode from UTF-8.
It's different ways of saying the same thing. I don't know which is better. RDBMS's could store Unicode as an array of integers, but instead they store it as an encoded byte string. I believe Python uses UCS-16 or UCS-32, not UTF-16, but you're not supposed to know that. You're supposed to treat Unicode as an opaque type.
** Where to put engine_from_config "And append this to the load_environment function:" should be "And append this to *the end* of the load_environment function:" (After "# CONFIGURATION OPTIONS HERE" might be better)
Again, different ways of saying the same thing. I changed it to "Put this at the end of your load_environment function."
** Where's init_app? "Why is some code in init_app and other code isn't?" init_app is not mentioned until now. (I first thought this is a typo of init_model) "Why is some code in init_app in config/environment.py and other code isn't?" would be nice.
It does mean init_model. init_app was an earlier name for that function. Fixed.
** What is websetup.py? I could not understand what websetup.py is for. Please add some explanation on this.
websetup.py is called by "paster setup-app". I don't see how to put an explanation in without making it too verbose, since "paster setup-app" is not introduced until later.
* Step 4.2 - Adding Content ** Path to site.html ~/MyBlog/myblog/templates/toolkit/index.html ~/MyBlog/myblog/templates/toolkit/add.html The path to the site.html written in above two file should be '/blog/ site.html', not '/site.html'
Fixed.
-- Mike Orr <slug...@public.gmane.org>




