Re: Pylons 2 users guide, first draft

2010-10-02 Thread Madhu Alagu
Hi, >matchdict = self.request.matchdict >login = db.load_form(matchdict['id'] It works Thanks Madhu Alagu On Oct 2, 7:10 pm, blaf wrote: > Sorry it wasn't clear and I missed an ) > > def forms(self): >         lmatchdict = self.request.matchdict >         login = db.load_form(matchdict['id']

Re: Pylons 2 users guide, first draft

2010-10-02 Thread blaf
Sorry it wasn't clear and I missed an ) def forms(self): lmatchdict = self.request.matchdict login = db.load_form(matchdict['id']) response = Response(login) response.content_type = 'application/vnd.mozilla.xul+xml' return response On Oct 2, 3:08 am, Madhu

Re: Pylons 2 users guide, first draft

2010-10-02 Thread blaf
Actually params are not passed to functions so you need to do: matchdict = self.request.matchdict login = db.load_form(matchdict['id'] On Oct 2, 3:08 am, Madhu Alagu wrote: > Hi, > > __init__.py > > def main(global_config, **settings): >     """ This function returns a Pylons WSGI application.

Re: Pylons 2 users guide, first draft

2010-10-02 Thread Madhu Alagu
Hi, __init__.py def main(global_config, **settings): """ This function returns a Pylons WSGI application. """ from pylons.configuration import Configurator config = Configurator(settings=settings) config.begin() config.add_cache() config.add_sessions() config.add_

Re: Pylons 2 users guide, first draft

2010-10-01 Thread Madhu Alagu
Hi, from pylons.views import action from ebro.db import DBSession as db from ebro.sf import SFSession as sf from pylons.controllers.util import Response class MyHandler(object): def __init__(self, request): self.request = request def login(self): login = db.load_form(

Re: Pylons 2 users guide, first draft

2010-09-30 Thread Ben Bangert
On Sep 30, 2010, at 9:43 AM, Mike Orr wrote: > CC'ing pylons-devel because these will be FAQs. >> @action >> def login(self): >> login=(db.load_form('login.kk')) >> self.request.response_content_type = >> 'application/vnd.mozilla.xul+xml' >> return login >> >> @action >>

Re: Pylons 2 users guide, first draft

2010-09-30 Thread Mike Orr
CC'ing pylons-devel because these will be FAQs. On Wed, Sep 29, 2010 at 10:55 PM, Alagu Madhu wrote: > >> >> I was thinking of: >> >> @action >> def login(self): >>    self.request.response.content_type = "application/vnd.mozilla.xul+xml" >>         login=ts.load_form('login.kk') >>         retur

Re: Pylons 2 users guide, first draft

2010-09-26 Thread Mike Orr
Ben, what are you thinking about release dates? We've gotten two comments already worried that Pylons 2 is about to turn the world upside down imminently. But my impression is there's still several months worth of development. So maybe a beta by the end of the year and the final sometime next winte

Re: Pylons 2 users guide, first draft

2010-09-26 Thread Chris McDonough
Pylons 2.0 hasn't been released yet, but when it is, it will have documentation which shows you to do this sort of thing "the new way". In the meantime, the code you have below will also work on the trunk without any changes, as far as I know. On Sun, 2010-09-26 at 06:38 -0700, Madhu Alagu wrote:

Re: Pylons 2 users guide, first draft

2010-09-26 Thread Madhu Alagu
hi, Pylons 1.0: def login(self): response.content_type = 'application/vnd.mozilla.xul+xml' login=st.load_form('login.kk') return login I would like to try in Pylons 2.0.The template source (st.load_form('login.kk') ) load from the remote server. thanks kk On Sep 2

Re: Pylons 2 users guide, first draft

2010-09-25 Thread Chris McDonough
On Sat, 2010-09-25 at 09:27 -0700, Ben Bangert wrote: > On Sep 25, 2010, at 4:43 AM, Santhosh wrote: > > > I checked the new developing version of pylons .The new version is > > entirely different from the older version . How can the developers > > follow this ? .The developers compelled to have c

Re: Pylons 2 users guide, first draft

2010-09-25 Thread Ben Bangert
On Sep 25, 2010, at 4:43 AM, Santhosh wrote: > I checked the new developing version of pylons .The new version is > entirely different from the older version . How can the developers > follow this ? .The developers compelled to have change the developed > software because if they remain in the old

Re: Pylons 2 users guide, first draft

2010-09-25 Thread Santhosh
Dear all I checked the new developing version of pylons .The new version is entirely different from the older version . How can the developers follow this ? .The developers compelled to have change the developed software because if they remain in the older version there may be have no support . P

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Ben Bangert
On Sep 20, 2010, at 10:17 PM, Mike Orr wrote: > How many full-time staff do you have available for two months? Just > converting the hundreds of references to plain text would take hours, > plus rewording the hundred-some pages of BFG docs and hundred-some > other docs and a few more for SQLAlchem

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Mike Orr
On Mon, Sep 20, 2010 at 9:09 PM, Ben Bangert wrote: > On Sep 20, 2010, at 2:58 PM, Mike Orr wrote: > >> BFG is bigger than all the other Pylons dependencies combined. We >> can't have 30% of the Pylons manual referring to BFG features that >> aren't normally used in Pylons apps, especially if Pylo

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Chris McDonough
On Mon, 2010-09-20 at 21:09 -0700, Ben Bangert wrote: > On Sep 20, 2010, at 2:58 PM, Mike Orr wrote: > > > BFG is bigger than all the other Pylons dependencies combined. We > > can't have 30% of the Pylons manual referring to BFG features that > > aren't normally used in Pylons apps, especially if

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Ben Bangert
On Sep 20, 2010, at 2:58 PM, Mike Orr wrote: > BFG is bigger than all the other Pylons dependencies combined. We > can't have 30% of the Pylons manual referring to BFG features that > aren't normally used in Pylons apps, especially if Pylons has a more > specific way to enable it. Indeed, but aft

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Chris McDonough
On Mon, 2010-09-20 at 14:58 -0700, Mike Orr wrote: > > > > AFAIK, Ben doesn't want to do that. He wants all the docs presented in > > terms of Pylons, not punting to the BFG docs for anything at all. > > BFG is bigger than all the other Pylons dependencies combined. We > can't have 30% of the Pyl

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Mike Orr
On Mon, Sep 20, 2010 at 1:55 PM, Chris McDonough wrote: > On Mon, 2010-09-20 at 13:50 -0700, Mike Orr wrote: >> On Sun, Sep 19, 2010 at 7:01 PM, Chris McDonough wrote: >> > On Sun, 2010-09-19 at 18:36 -0700, Ben Bangert wrote: >> >> Yea, we're going to have to compose copy/paste to an extent, fro

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Chris McDonough
On Mon, 2010-09-20 at 13:50 -0700, Mike Orr wrote: > On Sun, Sep 19, 2010 at 7:01 PM, Chris McDonough wrote: > > On Sun, 2010-09-19 at 18:36 -0700, Ben Bangert wrote: > >> Yea, we're going to have to compose copy/paste to an extent, from the > >> other docs. > > > > I've indicated to Ben that I am

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Chris McDonough
On Mon, 2010-09-20 at 13:41 -0700, Mike Orr wrote: > On Sun, Sep 19, 2010 at 6:36 PM, Ben Bangert wrote: > > On Sep 13, 11:49 am, Mike Orr wrote: > > > >> Can it be made into a request method so you don't have to pass the > >> request object? That would be more OO. > > > > Yea, maybe request.lin

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Mike Orr
On Sun, Sep 19, 2010 at 7:01 PM, Chris McDonough wrote: > On Sun, 2010-09-19 at 18:36 -0700, Ben Bangert wrote: >> Yea, we're going to have to compose copy/paste to an extent, from the >> other docs. > > I've indicated to Ben that I am willing to genericize the BFG docs to > some extent by not lin

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Mike Orr
On Sun, Sep 19, 2010 at 6:36 PM, Ben Bangert wrote: > On Sep 13, 11:49 am, Mike Orr wrote: > >> Can it be made into a request method so you don't have to pass the >> request object?  That would be more OO. > > Yea, maybe request.link? request.url would conflict with the webob url > property. It'

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Madhu Alagu
self.request.response_content_type = 'application/vnd.mozilla.xul+xml' thanks kk On Sep 20, 2:13 pm, Madhu Alagu wrote: > I need to add content_type. > > On Sep 20, 5:19 am, Chris McDonough wrote: > > > On Sun, 2010-09-19 at 19:11 -0700, Ben Bangert wrote: > > > On Sep 19, 2010, at 7:01 PM,

Re: Pylons 2 users guide, first draft

2010-09-20 Thread Madhu Alagu
I need to add content_type. On Sep 20, 5:19 am, Chris McDonough wrote: > On Sun, 2010-09-19 at 19:11 -0700, Ben Bangert wrote: > > On Sep 19, 2010, at 7:01 PM, Chris McDonough wrote: > > > > My $.02.. if you don't have a threadlocal tmpl_context around for > > > people to jam values onto/into,

Re: Pylons 2 users guide, first draft

2010-09-19 Thread Chris McDonough
On Sun, 2010-09-19 at 19:11 -0700, Ben Bangert wrote: > On Sep 19, 2010, at 7:01 PM, Chris McDonough wrote: > > > My $.02.. if you don't have a threadlocal tmpl_context around for > > people to jam values onto/into, it'd just confuse people if the dict > > values they returned from a view weren't

Re: Pylons 2 users guide, first draft

2010-09-19 Thread Ben Bangert
On Sep 19, 2010, at 7:01 PM, Chris McDonough wrote: > My $.02.. if you don't have a threadlocal tmpl_context around for > people to jam values onto/into, it'd just confuse people if the dict > values they returned from a view weren't passed as top-level names to > the template, and instead were ma

Re: Pylons 2 users guide, first draft

2010-09-19 Thread Chris McDonough
On Sun, 2010-09-19 at 18:36 -0700, Ben Bangert wrote: > Yea, we're going to have to compose copy/paste to an extent, from the > other docs. I've indicated to Ben that I am willing to genericize the BFG docs to some extent by not linking to internal stuff in API documentation needlessly. But I dou

Re: Pylons 2 users guide, first draft

2010-09-19 Thread Ben Bangert
On Sep 19, 2010, at 6:36 PM, Ben Bangert wrote: BTW, for anyone else that just saw this message appear apparently out of the blue, Google Groups does have the full thread but failed to e-mail it out. To catch up, just go to: http://groups.google.com/group/pylons-devel/browse_thread/thread/cf3578

Re: Pylons 2 users guide, first draft

2010-09-19 Thread Ben Bangert
On Sep 13, 11:49 am, Mike Orr wrote: > Can it be made into a request method so you don't have to pass the > request object?  That would be more OO. Yea, maybe request.link? request.url would conflict with the webob url property. > Or do you have to paste the markup text from the subprojects and

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
On Mon, Sep 13, 2010 at 10:45 AM, Ben Bangert wrote: >> Where is pylons.url now? request.url? > > from pylons.url import route_url > > Then just, route_url(request, 'route_name', **extra_args). It works largely > like the BFG route_url, except honors an additional URL generator option that >

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
On Mon, 2010-09-13 at 10:45 -0700, Ben Bangert wrote: > On Sep 13, 2010, at 12:09 AM, Mike Orr wrote: > >> I'll move some of the background paragraphs into separate pages. But >> this page will focus on the minimal app. >> >> Do you have any sample applications in both Pylons 1 and Pylons 2 that

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
On Mon, Sep 13, 2010 at 12:33 AM, Chris McDonough wrote: >> I guess that means myapp/__init__.py will have to initialize the >> logging. Because who else will? > > I figured it would just go in the .ini file as before, and PasteDeploy > would initialize it as always. Oh, duh, I didn't realize it

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
On Sun, 2010-09-12 at 23:40 -0700, Mike Orr wrote: >> >> Probably should still live in INI file. > >>> I suppose a logging configuration may not belong in the minimal >>> application, but in that case I'd have to provide the code to paste >>> in. (Maybe using paste.translogger as a sample middlew

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
On Mon, 2010-09-13 at 00:09 -0700, Mike Orr wrote: > I notice that ``request[foo]`` shadows ``request.environ[foo]``. Has > WebOb always done that? This is a behavior of the repoze.bfg subclass of WebOb (in repoze.bfg.request.Request). It's only for backwards compatibility with applications wri

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
On Sun, Sep 12, 2010 at 3:29 PM, Ben Bangert wrote: > Also, not sure what type of license Ian has his Paste docs under, but I want > to pull in the necessary information about how to configure INI files, such > that a user doesn't have to go to the PasteDeploy docs to look-up how to set > a fil

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ben Bangert
On Sep 13, 2010, at 11:49 AM, Mike Orr wrote: > Can it be made into a request method so you don't have to pass the > request object? That would be more OO. Sure, request.url though makes it ambiguous if its the request URL vs a url function. Ian called it request.link in his example app using R

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ben Bangert
On Sep 13, 2010, at 12:09 AM, Mike Orr wrote: > I'll move some of the background paragraphs into separate pages. But > this page will focus on the minimal app. > > Do you have any sample applications in both Pylons 1 and Pylons 2 that > I can include? The more sophistocated one with multiple acti

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
On Sun, Sep 12, 2010 at 1:10 PM, Ben Bangert wrote: > Mike, this is a great first step! :) :) > I think your "hello, world" in Pylons 2 should probably be adapted into a > "Learning Pylons 2 for the Pylons 1 User" type document. As it does a great > job explaining differences in terminology, w

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
On Sun, Sep 12, 2010 at 3:13 PM, Chris McDonough wrote: >>> CM: the ability to use a common "main template" for theming >> >> That's good. the more we can describe the practical benefits, the >> better. There are several things like theming and a grandparent site >> template for subapplications t

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
"Hello" (capitalized) is working now, and the interactive traceback. I adjusted the guide for those and for the new location of the static files. I adjusted the text for describing Routes and CM's other points. -- Mike Orr -- You received this message because you are subscribed to the Google G

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ben Bangert
On Sep 12, 2010, at 3:39 PM, Chris McDonough wrote: > Most of this is already handled via "paster points", e.g. do > "env/bin/paster points paste.filter_app_factory" in a virtualenv that > has Pylons installed. What that doesn't do is give you the "egg name", > although you don't really need the

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ben Bangert
On Sep 12, 2010, at 3:13 PM, Chris McDonough wrote: >> What's the best way to figure out the entry point name to use and the >> right syntax, for any arbitrary entry point? > > It's egg:#entrypointname > > The entry point names for a given package are in > EGG-INFO/entrypoints.txt . > > Paste d

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
On Sun, 2010-09-12 at 15:29 -0700, Ben Bangert wrote: > On Sep 12, 2010, at 3:13 PM, Chris McDonough wrote: > >>> What's the best way to figure out the entry point name to use and the >>> right syntax, for any arbitrary entry point? >> >> It's egg:#entrypointname >> >> The entry point names for

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ian Bicking
On Sun, Sep 12, 2010 at 5:13 PM, Chris McDonough wrote: > I saw that pipeline in an example INI Ben showed me, but I didn't > realize he wanted to do it across the board. I have never liked IN I > pipelines; they're hard to understand and non-Python syntax (which > means it could be hard to trace

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
On Sun, 2010-09-12 at 13:00 -0700, Mike Orr wrote: > Comments to Chris' comments. > >> MO: The static files are moved; they’re in the templates directory rather >> than in “hello/static”. > >> CM: I think we'll want to move the static files out of the > templates directory and up into a peer of

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Mike Orr
Comments to Chris' comments. > MO: The static files are moved; they’re in the templates directory rather > than in “hello/static”. > CM: I think we'll want to move the static files out of the templates directory and up into a peer of the templates directory. I made a mistake here. The tradition

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
Whoops, I meant to respond to your inline questions too. I responded to the ones I knew the answers to. On Sun, 2010-09-12 at 04:24 -0700, Mike Orr wrote: > I've got a first draft of the Pylons 2 Users Guide done. The "hello > world" page is the only page that's completed; it goes through > insta

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Chris McDonough
Hi Mike, Looks good, thanks a lot! I added some comments via a fork at: http://bitbucket.org/chrism/pylons-execution I changed some paster template code as a result of your investigation; the details are in the fork's comments. - C On Sun, 2010-09-12 at 04:24 -0700, Mike Orr wrote: > I've go

Re: Pylons 2 users guide, first draft

2010-09-15 Thread Ben Bangert
On Sep 12, 2010, at 4:24 AM, Mike Orr wrote: > I've got a first draft of the Pylons 2 Users Guide done. The "hello > world" page is the only page that's completed; it goes through > installing a default application and looking through the application > code. I haven't gone through the Pylons code