Hi Matt, I'm not an expert in Pyramid, if I'm wrong I hope someone in the list corrects me, so take my advice as an opinion from someone who uses Pyramid sporadically.
I see Pyramid as just an application (a WSGI app) that just takes requests and returns responses. The rest of Pyramid functionality is to configure the application in the way it processes the requests and returns the responses. Well, you have also events that are sent when the Pyramid application is created but the focus is on request-response machinery. See: http://docs.pylonsproject.org/projects/pyramid/1.0/narr/router.html For things related to the database I use some maintenance I run some cron jobs with scripts that connect directly to ZODB. Those scripts connect directly to ZODB, they don't need any Pyramid code. Nothing stops you from working with ZODB directly from plain Python, you only have to be careful if you need multiple processes connecting at the same time, you need to run ZODB with ZEO in that case. See: http://www.zodb.org/zodbbook/installing.html#setting-up-a-connection http://docs.repoze.org/zodbconn/ What other things you have mind where you think you it's awkward to use a request? -- Danny Navarro | http://dannynavarro.net On Sat, Jun 11, 2011 at 7:13 PM, Matt Feifarek <[email protected]> wrote: > Hi there. > I'm a relatively long-time Pylons user, starting to work with Pyramid. I > like what I see, but am suffering a bit on where to find things. > I'm using traversal and a resource tree in my app (zodb template) and am > enjoying this pattern... but I can't seem to find ways to hook onto basic > objects like the resource root, the settings, config, etc. I know that these > things are attached to the request, but I'm not sure that the best way to go > is to pass the request everyplace... if I just want to talk to the database, > can I really only do that via a request? > Say I have a utility function that needs to peek in the database (zodb > again) to find some elementary thing... how can I do that if it's not in a > view callable and I don't explicitly pass request around? > There must be a way to do this for testing if nothing else (I know that > there are fake request objects for testing, but do they have root, etc. > also?) > OR, how can I grab onto the root, config and other goodies via an import? > Maybe that's the question? > -- Matt > > -- > You received this message because you are subscribed to the Google Groups > "pylons-discuss" 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/pylons-discuss?hl=en. > -- You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en.
