[TurboGears] Re: Schema.if_key_missing

2005-11-04 Thread Ian Bicking
[EMAIL PROTECTED] wrote: Ian Bicking wrote: Sometime a while ago someone asked about an option to have the schema fill in values that are missing. I can't remember who. Anyway, it took a while, but now it's there in r1218 as an option on Schemas: # If this is given, then any keys

[TurboGears] Re: Schema.if_key_missing

2005-11-04 Thread [EMAIL PROTECTED]
Ian Bicking wrote: This change doesn't fit my usage scenario. What I have is like this : a=dict(a set of keyword string values from web page) s_a = schema(build from SQLObject data validators) s_b = schema(a subset of fields in a, that is not in s_a) I want to validate: o =

[TurboGears] Re: OT: Development olatform opinions (To Mac...?)

2005-11-04 Thread Matthew Bevan
I've been using Gentoo Linux for the last year and a half without any trouble. It is, in fact, the only operating system I use, and it works better than anything else I could imagine. My workflow revolves around three applications, and three active windows, with Gimp thrown in there

[TurboGears] Re: run as cgi!?

2005-11-04 Thread Axel Steiner
Hi, i haven't actually tried it, but there's documentation on running cherrypy as a CGI application (via WSGI): http://www.cherrypy.org/wiki/RunAsCGI there are warnings about it not supporting any very complex use of cherrypy's functionality which probably isn't a good sign, but if

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Lee McFadden
I haven't really tried this myself yet, but I looked into it and the only thing I could find that may be useful is cherrypy.headerMap[1]. Using this you may be able to alter the response code of the page given certain criteria. - Lee [1] http://www.cherrypy.org/wiki/ReturnVsYield - See the

[TurboGears] Kid templating question.

2005-11-04 Thread Matthew Bevan
Howdy! I'm attempting to create a complex template structure for the website of the company I work for. Because of the scope of the site I need the template to be as flexible as possible. To that end, I would like to create a master.kid template which defines several areas or slots which

[TurboGears] Re: Kid templating question.

2005-11-04 Thread Wavy Davy
On 04/11/05, Matthew Bevan [EMAIL PROTECTED] wrote: -- H -- L |C | R -- F -- Seems a fairly standard layout, I use a similar method, with optional parts I've attempted to use py:match statements to accomplish what I want, but I can not seem to find any reference to

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Elvelind Grandin
Great :) On 11/4/05, Phillip J. Eby [EMAIL PROTECTED] wrote: Kevin Dangoor wrote: On 11/3/05, Phillip J. Eby [EMAIL PROTECTED] wrote: (Just to be clear, the warning above is in this specific case harmless, so you don't need to upgrade setuptools or do any other steps I've listed

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Sean Cazzell
I think this is the way to do it: http://www.cherrypy.org/trunk/docs/book/chunk/ch03.html#id3221100 http://www.cherrypy.org/wiki/HandleErrors Kind Regards, Sean Cazzell On Fri, 2005-11-04 at 09:46 +, Lee McFadden wrote: I haven't really tried this myself yet, but I looked into it and

[TurboGears] Re: rough testing doc

2005-11-04 Thread sindpipermidi
Hi Kevin, We're evaluating TG and are looking on how we can develop our web app test-first. In writing our first tests, we ran into this issue. We found back this bug in trac, it's ticket number 70. Can you comment on when this issue will be fixed? Will it be fixed in 0.9 or 1.0? Is there a way

[TurboGears] Re: TurboGears forms first look

2005-11-04 Thread Kevin Dangoor
On 11/4/05, gsteff [EMAIL PROTECTED] wrote: I like the idea of providing the sequence of widgets via *args instead of an explicit list. I do, too. I think I'll change that... Kevin

[TurboGears] to has_error or not to has_error

2005-11-04 Thread Kevin Dangoor
This came up in the thread about the forms package, but I just wanted to see if there were other opinions on this. So, the proposal is to: 1) deprecate validation_error. For now, if validation fails and you have a method, it will be called but a DeprecationWarning will be displayed. 2) if

[TurboGears] Re: rough testing doc

2005-11-04 Thread Kevin Dangoor
Hi Nick, This one is not obvious... I put a note in the ticket about what I think the solution is and set the milestone to 0.9. You can also do a workaround... Something like this: class Dummy: pass oldrequest = None oldresponse = None def setup_module(): global oldrequest global

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Jeff Watkins
Just before rendering your template, set the response status: cherrypy.response.status=404On 3 Nov, 2005, at 11:12 pm, Jeff Grimmett wrote:I'm a little confused on error handling in TG versus CherryPy itself. The CP site has a few examples of how to ensure that a 404 response is sent for a page

[TurboGears] Re: OT: Development olatform opinions (To Mac...?)

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Matthew Bevan [EMAIL PROTECTED] wrote: I've been using Gentoo Linux for the last year and a half without any trouble. It is, in fact, the only operating system I use, and it works better than anything else I could imagine. My workflow revolves around three applications, and

[TurboGears] Re: SQLite and relative paths?

2005-11-04 Thread Kevin Dangoor
On 11/3/05, Jon [EMAIL PROTECTED] wrote: Is there any way to use SQLite without having to specify an absolute path to the file? I'd prefer to be able to specify it relative to the root project directory. Even if there was a way to do it syntactically, this would be tricky come deployment

[TurboGears] Re: Kid templating question.

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Matthew Bevan [EMAIL PROTECTED] wrote: -- H -- L |C | R -- F -- All of them are optional except the content area, and the left column should default to some sane default (i.e. a current events listing). Note also that you could also use py:defs for the

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Kevin Dangoor
On 11/3/05, Phillip J. Eby [EMAIL PROTECTED] wrote: And while we're speaking of next-gen features, I've just made the 'develop' command in subversion take all the same options as easy_install, and inherit the easy_install settings from any configuration files. So if you set e.g.:

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Kevin Dangoor
On 11/3/05, Jeff Grimmett [EMAIL PROTECTED] wrote: What's the best way to handle this? Dispose of default() and use the CP error handler instead? That is a better route, because the default method will only work for a single controller. _cpOnError will apply for all of the controllers down the

[TurboGears] Re: Refined Error Handling

2005-11-04 Thread Kevin Dangoor
Hi, um , Gun On 11/1/05, Gunfighter [EMAIL PROTECTED] wrote: So how can these be improved? Some obvious suggestions come to mind. One particular thought is to have the error handling page load the Simple Description, TraceBack, and any other pertinent information in JSON format. Perhaps

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Jeremy
Well, between both Kevin and Phillip, it seems to be working now.. However, there should be an easy to to uninstall all of this stuff, I would imagine... I have a mac. Are all the libraries installed under MacPython? Or are they stored in the system libraries?? Thanks! Jeremy

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Jeremy
Well, between both Kevin and Phillip, it seems to be working now.. However, there should be an easy to to uninstall all of this stuff, I would imagine... I have a mac. Are all the libraries installed under MacPython? Or are they stored in the system libraries?? Thanks! Jeremy

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Jeremy
Nevermind... :D Now when I start an instance.. I get: asimov:~/jeremy jeremy$ python jeremy-start.py Traceback (most recent call last): File jeremy-start.py, line 3, in ? pkg_resources.require(TurboGears) File

[TurboGears] Re: Help with this error

2005-11-04 Thread Kevin Dangoor
On 11/2/05, redneck [EMAIL PROTECTED] wrote: File /usr/local/lib/python2.4/site-packages/kid-0.7adev_r186-py2.4.egg/kid/pull.py, line 91, in expand stack[-1].append(current) TypeError: append() argument 1 must be Element, not instance Ahh... I think I see the problem. There's a bug in

[TurboGears] TurboGears Books

2005-11-04 Thread Chad L.
Anyone know of any TurboGears books in the works? I would think O'Reilly would be all over this...?

[TurboGears] Re: TurboGears Books

2005-11-04 Thread Steve Bergman
Chad L. wrote: Anyone know of any TurboGears books in the works? I would think O'Reilly would be all over this...? T'would be nice. But don't hold your breath. One of the problems with using the best tools instead of the most popular ones is that there never seem to be many book on

[TurboGears] Re: Should I worry?

2005-11-04 Thread Bryan Murdock
On 11/4/05, Bryan Murdock [EMAIL PROTECTED] wrote: On 11/3/05, Jeff Grimmett [EMAIL PROTECTED] wrote: On 11/3/05, Tim Lesher [EMAIL PROTECTED] wrote: Yep. It's an intrusion attempt. Get used to them. :-) Most likely, some other customer of Verizon has an infected box.

[TurboGears] Re: TurboGears Books

2005-11-04 Thread Ian Bicking
Steve Bergman wrote: Chad L. wrote: Anyone know of any TurboGears books in the works? I would think O'Reilly would be all over this...? T'would be nice. But don't hold your breath. One of the problems with using the best tools instead of the most popular ones is that there never

[TurboGears] Kid HTML Entities

2005-11-04 Thread Matthew Bevan
Howdy! For those of us who use HTML entities a lot (arrows, brackets, quotes, dashes, and spaces most notably) I've bookmarked the following. http://bclary.com/2004/11/25/html-entities It's a list of standard ISO 8859-1 (Latin-1) entities with their HTML name and number. To use the

[TurboGears] Re: Turbogears REST style

2005-11-04 Thread Ronald Jaramillo
Hej Roman, I described a naive approach on my blog a couple of months ago: http://www.checkandshare.com/blog/?p=8 Cheers Ronald On Nov 4, 2005, at 6:00 PM, Roman wrote: Ok, I've found REST in post REST recipe cherrypy. Will first read through this...

[TurboGears] Re: Should I worry?

2005-11-04 Thread Jeff Grimmett
On 11/4/05, Bryan Murdock [EMAIL PROTECTED] wrote: You can usually paste the pertinent line from your log into google and figure out exactly which worm is checking you out, if you are curious.Ah, Google. Is there nothing it can't do? Thanks :-) -- Things fall apart. The Center cannot hold.- Life

[TurboGears] Re: Should I worry?

2005-11-04 Thread Bryan Murdock
On 11/3/05, Jeff Grimmett [EMAIL PROTECTED] wrote: On 11/3/05, Tim Lesher [EMAIL PROTECTED] wrote: Yep. It's an intrusion attempt. Get used to them. :-) Most likely, some other customer of Verizon has an infected box. Well, it's good to know what they look like. What's curious is

[TurboGears] Model testing

2005-11-04 Thread Jason Chu
So far my application isn't at a stage to do functional or even unit tests of the controllers, but I do have a bunch of model objects and a little bit of logic around them. I read the little testing doc and it says that there is no support for testing model objects. I'm now trying to figure out

[TurboGears] Re: OT: Development olatform opinions (To Mac...?)

2005-11-04 Thread Bob Ippolito
On Nov 4, 2005, at 5:42 AM, Kevin Dangoor wrote: On 11/4/05, Matthew Bevan [EMAIL PROTECTED] wrote: I've been using Gentoo Linux for the last year and a half without any trouble. It is, in fact, the only operating system I use, and it works better than anything else I could imagine. My

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Phillip J. Eby [EMAIL PROTECTED] wrote: asimov:~/turbogears jeremy$ sudo python setup.py develop --script-dir=/usr/local/bin Traceback (most recent call last): File setup.py, line 14, in ? from docgen import GenSite File /Users/jeremy/turbogears/docgen.py,

[TurboGears] Re: Kid HTML Entities

2005-11-04 Thread Kevin Dangoor
This looks like a good reference for the unicode character codes (and it also covers some of the latin-1 characters): http://www.pemberley.com/janeinfo/latin1.html Kevin On 11/4/05, Matthew Bevan [EMAIL PROTECTED] wrote: Howdy! For those of us who use HTML entities a lot (arrows, brackets,

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Ian Bicking
Kevin Dangoor wrote: On 11/4/05, Phillip J. Eby [EMAIL PROTECTED] wrote: asimov:~/turbogears jeremy$ sudo python setup.py develop --script-dir=/usr/local/bin Traceback (most recent call last): File setup.py, line 14, in ? from docgen import GenSite File

[TurboGears] Re: Model testing

2005-11-04 Thread Kevin Dangoor
Hi Jason, A few comments that may clear things up and make it easier: - you can set model.__connection__ to something else, if you need to change it for testing purposes - PackageHub does not even look up the connection configuration until it's needed. It should be possible to close and clear

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Phillip J. Eby
Kevin Dangoor wrote: On 11/4/05, Phillip J. Eby [EMAIL PROTECTED] wrote: asimov:~/turbogears jeremy$ sudo python setup.py develop --script-dir=/usr/local/bin Traceback (most recent call last): File setup.py, line 14, in ? from docgen import GenSite File

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Phillip J. Eby [EMAIL PROTECTED] wrote: I'm puzzled as to why explicitly asking for Kid = 0.6.4 cares about the TurboGears egg info... Because to determine whether Kid is available, pkg_resources has to scan sys.path, and in the process it encounters the (broken) Turbogears

[TurboGears] Re: Model testing

2005-11-04 Thread Jason Chu
Well here's something interesting. In the simple cases, PackageHub doesn't try to open a connection until it's actually trying to access the database. If you have a subclass of a subclass of a SQLObject (in my case it's SomeClass-Modifiable-SQLObject) some of the metaclass magic behind SQLObject

[TurboGears] Re: Model testing

2005-11-04 Thread Kevin Dangoor
If you come up with some techniques you'd like to share, please post them to the wiki: http://trac.turbogears.org This *is* an area that needs to be filled in... I just haven't personally had the time to do so, so any help is a boon.. Thanks! Kevin On 11/4/05, Jason Chu [EMAIL PROTECTED]

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Phillip J. Eby
Kevin Dangoor wrote: ugh. At one point, I had checked in the .egg-info directory, but then people complained about getting conflicts there. try python setup.py egg_info and then rerun the develop command. That's not gonna work. See below. asimov:~/turbogears jeremy$ sudo python

[TurboGears] Re: TurboGears Books

2005-11-04 Thread Tim Lesher
On 11/4/05, Steve Bergman [EMAIL PROTECTED] wrote: Chad L. wrote:Anyone know of any TurboGears books in the works?I would thinkO'Reilly would be all over this...?T'would be nice.But don't hold your breath.One of the problems with using the best tools instead of the most popular ones isthat

[TurboGears] Re: Interesting thoughts on code generation

2005-11-04 Thread Roger Espinosa
1) You can still do customization through CSS alone.My feeling is that between CSS, and a bit of _javascript_ behaviors, a designer can customize likely in a much richer fashion than if they were fiddling with templates. In the olden days, the designer had to have a heavy hand on templates. No

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Jeremy
Ahh... that clears everything up. Well, I am glad someone is clear... :D I am as confused as ever. But, I don't know jack about python. I just changed setup.py slightly so that it doesn't import docgen at all if docs doesn't appear on the command line. --help-commands won't list docs

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Jeremy [EMAIL PROTECTED] wrote: Ahh... that clears everything up. Well, I am glad someone is clear... :D I am as confused as ever. But, I don't know jack about python. This particular conversation goes a bit beyond just python... the setuptools/Python Eggs thing is new.

[TurboGears] Re: Interesting thoughts on code generation

2005-11-04 Thread Michele Cella
Kevin Dangoor wrote: Hi Michele, Hi Kevin, Thanks for taking the time to write this. I know how long it can take to write something in a non-native language. Thank you for giving me your attention. On 11/4/05, Michele Cella [EMAIL PROTECTED] wrote: I've just found this link to a post

[TurboGears] Re: Interesting thoughts on code generation

2005-11-04 Thread william
Michele, thanks, this is a good summary of my ideas. Quickstart should be able to generate a kind of pseudo-code. If re-generation are need, why not take advantage of the inheritance at class level (or at object level like in Zope). But this can add lot of complexity; I like simplicity ;-).

[TurboGears] Turbogears REST style

2005-11-04 Thread Roman
Hi I currently have a little, Python based web application (CGI, without any web framework). Now I consider migrating to Django or Turbogears.I'd like to have the new version RESTful. Anybody done this based on Turbogears? Is Turbogears adequate for such an endeavour? Basically, a Turbogears

[TurboGears] Re: Interesting thoughts on code generation

2005-11-04 Thread Michele Cella
Michele Cella wrote: widgets.TextField(name, template=myproject.templates.textfield) This is a feature I didn't notice, and I think that's a quite important feature, If i got it right you are directly referencing a Kid template, right? Now I will not say again see below but I will

[TurboGears] Re: I broke my TG install :D

2005-11-04 Thread Jeremy
Cool... Well, here is where I stand now.. After both doing a svn up and deleting turbogears and checking out the source from scratch, whenever I try to install, I get Processing dependencies for TurboGears==0.9a0dev-r138 Searching for kid=0.7adev-r186 Reading

[TurboGears] Re: Deploying a TG app

2005-11-04 Thread Aggelos Orfanakos
One more thing. I have my app installed in the target machine (.egg) using prod.cfg. TG assumes that the path to the database (file) exists (e.g. you have taken care of creating it using tg-admin) or it rather creates it if it doesn't exist? I had some problems when not creating the database a

[TurboGears] Consistent CherryPy hang on TCP reset

2005-11-04 Thread Tim Lesher
Server: FreeBSD 6.0, Python 2.4.2, CP 2.1 Client: WinXP SP1, Firefox 1.07 I'm seeing a consistent hang in CherryPy when a client issues a TCP reset. The easiest way to repro it: On the server: 1. tg-admin quickstart resettest 2. cd resettest python resettest-start.py On the client: 1. Go to

[TurboGears] Re: TurboGears Books

2005-11-04 Thread Mark Ramm
I think that's more pessimistic than necessary; publishers won't necessarily beat down the door, but the first step would be a pitch. I've only flirted in the lightest way with book authoring (or maybe just slightly less lightly with writing articles for pay), but the obstactles didn't seem

[TurboGears] Re: SQLObject : subselect joins orderby

2005-11-04 Thread Peter Kahle
Answers inline, and haven't tested them, but I'm pretty sure they're correct, except where I note questions. I mostly did this as a way to learn SQLObject in a more complicated way than I had up till now. And I read the whole of this thread, but I've got something around 300 messages to

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Jeff Grimmett
On 11/4/05, Jeff Watkins [EMAIL PROTECTED] wrote: Just before rendering your template, set the response status: cherrypy.response.status=404 That works pretty well, though any images (etc) on the page get sent with a 200 response code. I'm guessing this is OK since the URL requested actually gets

[TurboGears] Re: Deploying a TG app

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Aggelos Orfanakos [EMAIL PROTECTED] wrote: One more thing. I have my app installed in the target machine (.egg) using prod.cfg. TG assumes that the path to the database (file) exists (e.g. you have taken care of creating it using tg-admin) or it rather creates it if it doesn't

[TurboGears] Re: Model testing

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Ian Bicking [EMAIL PROTECTED] wrote: I wouldn't reuse SQLObject's own test code. It was written before ConnectionHub, so has some added complexity there, and also has some optimizations that make things more complex and I suspect don't actually make the tests run any faster.

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Kevin Dangoor
On 11/4/05, Jeff Grimmett [EMAIL PROTECTED] wrote: Hm. No matter what I tried, I wasn't hitting the error handler. The page in question also seems to be a little off on a number of points (wrong package, etc). Methinks handling of _cpOnError may have changed and it's not yet in the docs. I

[TurboGears] Re: noob -- Page.byPagename()?

2005-11-04 Thread Kevin Dangoor
On 11/4/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hello, I've recently installed turbogears again myself and have run into this same problem. I'm following the tutorial and at the end of page two I'm getting this error. SQLObjectNotFound: The Page by alternateID pagename='FrontPage'

[TurboGears] Re: Returning a 404 response

2005-11-04 Thread Jeff Grimmett
On 11/4/05, Kevin Dangoor [EMAIL PROTECTED] wrote: I vaguely remember seeing some mention about not founds not going through _cpOnError. We definitely should get to the bottom of this and add it to quickstart.Agreed, that's the right thing to do. I'm quite certain it gets called for exceptions. I

[TurboGears] Coding style question

2005-11-04 Thread Sean Cazzell
The TurboGears site suggests PEP 8 style be used but I have noticed CherryPy, SQLObject and TG mostly use mixedCase style for method names. So is the official recommendation PEP 8 but mixedCase methods? Kind Regards, Sean Cazzell

[TurboGears] Escaping HTML when editing in Catwalk

2005-11-04 Thread Jeff Grimmett
Hi,I've tried a number of ways of editing content via Catwalk and for some reason I'm not having a whole lot of luck.1) For example: Hello to b71.99.233.43/b will be reproduced exactly that way if it's extracted into a Kid template - i.e. the b markup is seen verbatim without being rendered as a

[TurboGears] Re: Coding style question

2005-11-04 Thread Ian Bicking
Sean Cazzell wrote: The TurboGears site suggests PEP 8 style be used but I have noticed CherryPy, SQLObject and TG mostly use mixedCase style for method names. So is the official recommendation PEP 8 but mixedCase methods? SQLObject gets that style from Webware. But otherwise I've personally

[TurboGears] Re: SQLObject : subselect joins orderby

2005-11-04 Thread Todd Greenwood
Peter, thanks for the assist. A couple of notes: I was hoping to display a page that listed page names and last mod date, with the last modifed (10) pages listed... 1) Neither query returns the mod_date_time itself, so I'll still have to resort to either hitting the db for each of the last 10

[TurboGears] Re: TurboGears Books

2005-11-04 Thread modmans2ndcoming
Cripes, you better not start on a book yet.. then TG 1.0 will never get out :-P