mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread eleith

i'm using the latest pylons/mako/sqlalchemy with most of the defaults
in place.

i built a form that submitted the following -  étudiant. which was
then added into a table using sqlalchemy

that works fine.

then, when i try to print it out in a mako template as such

div
 c.name
/div

where c.name =  étudiant. as retrieved from the sqlalchemy query,
mako gives me the codec can't decode byte error.

based on the interactive debugging, c.name is of type unicode. i've
gone through the basic unicode documents in the pylons docs, but maybe
it's late and maybe i'm a little tired, as i can't seem to fix this.

anyone got an easy solution for this one?



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread eleith

i meant

div ${c.name}/div

On Nov 18, 1:16 am, eleith [EMAIL PROTECTED] wrote:
 i'm using the latest pylons/mako/sqlalchemy with most of the defaults
 in place.

 i built a form that submitted the following -  étudiant. which was
 then added into a table using sqlalchemy

 that works fine.

 then, when i try to print it out in a mako template as such

 div
  c.name
 /div

 where c.name =  étudiant. as retrieved from the sqlalchemy query,
 mako gives me the codec can't decode byte error.

 based on the interactive debugging, c.name is of type unicode. i've
 gone through the basic unicode documents in the pylons docs, but maybe
 it's late and maybe i'm a little tired, as i can't seem to fix this.

 anyone got an easy solution for this one?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



PROPOSAL: breakpoint function in Pylons

2007-11-18 Thread Thotep

Hi,
what do you think about adding a breakpoint-like function in Pylons?
In my opinion it should look like this:
- calling the breakpoint() function (for example in a controller)
would fire up the Pylons debugger in web browser in almost the same
form, as in the case of an error - with the exception of a Run
button, which will run the application further.
- breakpoint(boolean_arg) - stops only when boolean_arg == True.

That's the basis of a breakpoint() function idea. Furthermore new
buttons could be added - Step into, Step over etc.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread Evert Rol


 where c.name =  étudiant. as retrieved from the sqlalchemy query,
 mako gives me the codec can't decode byte error.

'decode' or 'encode' error? Outputting (as in 'str(c.name)') gives me  
the encode variant; any copied traceback is easier to have.

 based on the interactive debugging, c.name is of type unicode. i've
 gone through the basic unicode documents in the pylons docs, but  
 maybe
 it's late and maybe i'm a little tired, as i can't seem to fix this.

Try ${c.name.encode('utf8')}

(if it really was the decode variant, try the .decode('utf8') instead)

There's more on python  unicode on the www than just the pylons  
docs; Google around, it will help make things clearer.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread Christoph Haas

On Sun, Nov 18, 2007 at 01:20:54AM -0800, eleith wrote:
 i meant
 
 div ${c.name}/div

I figured. :)

Did you declare your Mako template file as UTF8? I always prepend my
template files with:

# -*- coding: utf-8 -*-

Since Pylons 0.9.6 you do not need to do any fancy encoding stunts. Just
pass around unicode strings and declare the encoding of your templates
correctly and that should be it.

 Christoph


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Is the --daemon switch broken?

2007-11-18 Thread voltron

Is the --daemon switch broken? It quits with this error on my
system:

AttributeError: 'module' object has no attribute 'fork'

I am using windows 2000, python 2.4, pylons 09.6.1

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread eleith

the error from the debugger is the following

Module _main_main_mako:60 in render_body
  context.write(unicode(c.page.body))
type 'exceptions.UnicodeDecodeError': 'ascii' codec can't decode
byte 0xc3 in position 4775: ordinal not in range(128) 

[where c.page.body is the result of another render('innerpage.mako')
which does contain c.name]

the sqlalchemy url contains the params (?
use_unicode=1charset=utf8), which i assume means the results of my
queries are unicode

i am confused because, in the interactive debugger, if i print out the
variable c.name

i see that it is unicode and i am able to successfully run

unicode(c.name)

but it seems that mako is failing on the same operation. i have tried
including # -*- coding: utf-8 -*-  at the top of mako files, but it
did not work. also, i assumed we didn't have to do this in the 0.9.6
as utf8 output by mako is the default...

if i remove reference to ${c.name} in my mako file, all is well

On Nov 18, 7:32 am, Christoph Haas [EMAIL PROTECTED] wrote:
 On Sun, Nov 18, 2007 at 01:20:54AM -0800, eleith wrote:
  i meant

  div ${c.name}/div

 I figured. :)

 Did you declare your Mako template file as UTF8? I always prepend my
 template files with:

 # -*- coding: utf-8 -*-

 Since Pylons 0.9.6 you do not need to do any fancy encoding stunts. Just
 pass around unicode strings and declare the encoding of your templates
 correctly and that should be it.

  Christoph
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: mako rendering 'ascii' codec can't decode byte on variable from sqlalchemy

2007-11-18 Thread eleith

ok. i think i got it.

calling render, gives me a raw string.
then, i was having the results of (many) render, included in a
template of which i called render again at some later point.

by changing all my internal renders in templates to mako file
includes, it works properly.

thanks for everyone's helps, i appreciate it.

On Nov 18, 8:53 am, eleith [EMAIL PROTECTED] wrote:
 the error from the debugger is the following

 Module _main_main_mako:60 in render_body
   context.write(unicode(c.page.body))
 type 'exceptions.UnicodeDecodeError': 'ascii' codec can't decode
 byte 0xc3 in position 4775: ordinal not in range(128) 

 [where c.page.body is the result of another render('innerpage.mako')
 which does contain c.name]

 the sqlalchemy url contains the params (?
 use_unicode=1charset=utf8), which i assume means the results of my
 queries are unicode

 i am confused because, in the interactive debugger, if i print out the
 variable c.name

 i see that it is unicode and i am able to successfully run

 unicode(c.name)

 but it seems that mako is failing on the same operation. i have tried
 including # -*- coding: utf-8 -*-  at the top of mako files, but it
 did not work. also, i assumed we didn't have to do this in the 0.9.6
 as utf8 output by mako is the default...

 if i remove reference to ${c.name} in my mako file, all is well

 On Nov 18, 7:32 am, Christoph Haas [EMAIL PROTECTED] wrote:

  On Sun, Nov 18, 2007 at 01:20:54AM -0800, eleith wrote:
   i meant

   div ${c.name}/div

  I figured. :)

  Did you declare your Mako template file as UTF8? I always prepend my
  template files with:

  # -*- coding: utf-8 -*-

  Since Pylons 0.9.6 you do not need to do any fancy encoding stunts. Just
  pass around unicode strings and declare the encoding of your templates
  correctly and that should be it.

   Christoph
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Is the --daemon switch broken?

2007-11-18 Thread Ian Bicking

voltron wrote:
 Is the --daemon switch broken? It quits with this error on my
 system:
 
 AttributeError: 'module' object has no attribute 'fork'
 
 I am using windows 2000, python 2.4, pylons 09.6.1

Daemon mode only works on Posix/Unixy systems, not Windows.  I actually 
thought there wasn't even a --daemon option on Windows, but I guess I 
never actually made it conditional.


-- 
Ian Bicking : [EMAIL PROTECTED] : http://blog.ianbicking.org

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: Single or multi-database

2007-11-18 Thread Chris


Thanks Eric, interesting points you bring up.

I'm fairly confident that traffic across each subdomain (org) will be
roughly equal on average.  I see what you mean now that there could be
some performance overhead involved with the multidatabase approach.

I'll probably just stick with the single database.  Thanks.

On Nov 17, 1:00 am, EricHolmberg [EMAIL PROTECTED] wrote:
 Hi Chris,

 That's a great question that is going to be hard to answer on a
 general basis as it is implementation-specific (database server,
 database engine, memory, and hard drive speed).

 To do a gross oversimplification, if you have a single database server
 and you get a random mix of traffic from all of the sites, then having
 everything in one database and using your 'org_id' should be faster
 since you will have potentially fewer files open and the database has
 fewer indexes to cache.  But each database server and database engine
 handles table-to-file mapping and caching differently, so your mileage
 may vary.

 It would probably be very worthwhile to write some test applications
 to simulate queries to the database and get some numbers for your
 particular setup.  With a little tuning of the database cache and
 memory settings for a particular usage scenario, you can substantially
 increase the performance.

 To give you an idea of performance increases, I have some databases
 with over 900,000,000 records and just rebuilding the indexes took
 around 3 days with MySQL and MyISAM.  I checked the memory usage and
 the darned thing wasn't using even half of the memory it could.  It
 turned out that I needed to tweak the index (key) buffer settings
 which reduced the rebuild time to less than 8 hours.  Some of the
 newer database engines like InnoDB do a much better job with file and
 memory management so you don't have to tweak as much.  I've heard that
 other databases such as PostGRES are much better, but I don't have any
 first-hand experience to comment to that.

 Hope that helps somewhat.

 -Eric
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---



Re: CMS tools

2007-11-18 Thread Qiangning Hong

On Nov 18, 2007 7:46 PM, Mike Orr [EMAIL PROTECTED] wrote:

 A while ago there was discussion about a Pylons blog/CMS project
 called AroundWord.  It doesn't seem to exist anymore.
 http://aspn.activestate.com/ASPN/Mail/Message/python-announce/3522527
 Neither the domain nor the Google group exist.  Does anybody know what
 happened to it?  Are there any other Pylons-compatible CMS tools
 around?  I'm looking for something for my personal site, so no
 multi-editor or fancy permission schemes, just something with an admin
 interface to keep drafts private until they're finished, and posting
 to hierarchal URLs rather than diary blog entries.  Just wondering
 what exists before I start inventing it myself.

The team leader of AroundWord, Jonas Melian, decided to abandon the
project on Sep. 15, because he was in middle of a startup and moved
his interest to Ruby on Rails.  So, yes, AroundWord is dead.

I am still very interested in build a blog component for Pylons for my
own blog, which I promised my friends to build, but I am quite quite
busy for months and have no progress yet.  I'd like to help If you
start a project and opensource it.

 I may do it as a Cascade'able application so it can go between static
 pages and a dynamic Pylons app.

-- 
Qiangning Hong
http://www.douban.com/people/hongqn/

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
pylons-discuss group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~--~~~~--~~--~--~---