[pylons-discuss] Re: Possible to know if a reified method was called ?

2014-04-21 Thread Wyatt Baldwin
On Thursday, April 17, 2014 12:57:34 PM UTC-7, wilk wrote: Hi, For db connexion I use add_request_method with reify=True. In the end I commit only if this method was called. Now I use a tween and record the fact that the connexion was used or not, it's not a problem but I wonder if

[pylons-discuss] Re: [SqlAlchemy] how to return a primary key in scoped session?

2014-04-01 Thread Wyatt Baldwin
On Tuesday, April 1, 2014 2:46:06 AM UTC-7, Chung WONG wrote: For example: *DBSession = scoped_session(sessionmaker(extension=ZopeTransactionExtension()))* *class User(Base):* *id = Column(Integer,Sequence('user_id_seq'), primary_key=True)* *username = Column(Unicode(255),

[pylons-discuss] Re: Request initialisation code

2014-03-12 Thread Wyatt Baldwin
On Wednesday, March 12, 2014 3:46:04 AM UTC-7, Atul Agrawal wrote: Hello Everyone, I wanted my server to perform some task on every request that any user makes to my pyramid server. So I think of extending code where a request initialistaion is made.Something like overriding initialise

[pylons-discuss] Re: how to organise files in model package using sqlachemy?

2014-03-02 Thread Wyatt Baldwin
On Friday, February 28, 2014 11:58:15 PM UTC-8, Chung WONG wrote: I have a *models.py* that contains 10 classes. And I am trying to move all classes out of that file and put each class into its own file under a models package. I am using the alternative(at bottom of page) method mentioned

[pylons-discuss] Re: Period in url query string

2014-02-01 Thread Wyatt Baldwin
On Friday, January 31, 2014 10:59:19 AM UTC-8, Catherine Miller wrote: Hi, I've got a pylons api endpoint that looks like https://my-site/v1/controller/id I'd like to be able to allow id to be strings that contain periods (video.24 for example). However, this ends up getting resolved to

Re: [pylons-discuss] Re: pyramid_tm and disable transactions

2013-12-13 Thread Wyatt Baldwin
On Thursday, December 12, 2013 8:56:10 AM UTC-8, Jonathan Vanasco wrote: i think the memoized properties are better too. i just wanted to expand on something already in the docs. the only thing i'd note, is that it's recommended in the sqlalchemy docs to do `session.remove()` , not

Re: [pylons-discuss] Re: pyramid_tm and disable transactions

2013-12-11 Thread Wyatt Baldwin
On Wednesday, December 11, 2013 12:58:39 PM UTC-8, Jonathan Vanasco wrote: I'm using it in 3 views, in one of them, passing to other functions as a parameter. In this case, need I the scoped_session? the scoped_session just does some things with the thread to ensure you can grab a

[pylons-discuss] Re: regex in URL Dispatch+traversal

2013-11-06 Thread Wyatt Baldwin
On Tuesday, November 5, 2013 12:43:20 PM UTC-8, Emilio García-Pumarino Álvarez wrote: Hi! I have this route combined URL Dispatch + traversal: config.add_route('show', '/{t1}/{t2}/{t3}/{t4}-*{urlslug:[a-z\-]+*}', traverse='/{t1}/{t2}/{t3}/{t4}') When I type, for example, this

Re: [pylons-discuss] Re: regex in URL Dispatch+traversal

2013-11-06 Thread Wyatt Baldwin
to be the last character in the range block. On Wed, Nov 6, 2013 at 12:54 PM, Wyatt Baldwin wyatt.le...@gmail.comjavascript: wrote: On Tuesday, November 5, 2013 12:43:20 PM UTC-8, Emilio García-Pumarino Álvarez wrote: Hi! I have this route combined URL Dispatch + traversal: config.add_route

Re: log by request

2013-06-17 Thread Wyatt Baldwin
On Saturday, June 15, 2013 4:36:49 PM UTC-7, Jonathan Vanasco wrote: 2- a more customized version of the pyramid_exclog tween. i didn't like the log format, so i just re-implemented the package myself. I don't know if this would be useful to you, but I just pushed a change to

Re: Problem running pyramid 1.4 project with nginx+uwsgi

2013-04-21 Thread Wyatt Baldwin
Also, you probably don't want the --http option when using uwgi_pass w/ a socket. On Saturday, April 20, 2013 2:46:47 PM UTC-7, Michael wrote: Hi, I get Internal Server Error running a pyramid sqlalchemy scaffold app inside a virtualenv when I try to run it with uwsgi. However, when I run

Exceptions thrown in NewRequest subscriber don't get caught by pyramid_debugtoolbar

2013-02-13 Thread Wyatt Baldwin
I have a NewRequest subscriber that's added in main() via config.add_subscriber(). Exceptions thrown in this subscriber aren't caught by pyramid_debugtoolbar. Is this behavior expected? -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To

Re: Exceptions thrown in NewRequest subscriber don't get caught by pyramid_debugtoolbar

2013-02-13 Thread Wyatt Baldwin
1.0 where NewRequest subscribers explicitly did not support exceptions. On Wed, Feb 13, 2013 at 12:45 PM, Wyatt Baldwin wyatt.le...@gmail.comjavascript: wrote: I have a NewRequest subscriber that's added in main() via config.add_subscriber(). Exceptions thrown in this subscriber aren't

Re: Moving from Beaker SessionMiddleware to pyramid_beaker

2013-02-07 Thread Wyatt Baldwin
On Thursday, February 7, 2013 7:32:00 AM UTC-8, Jonathan Vanasco wrote: what are you using to manage sql connections in your app ? i dropped pyramid's transaction management and went with my own solution - which registers a db cleanup routine via a tween. depending on how your

Re: Moving from Beaker SessionMiddleware to pyramid_beaker

2013-02-07 Thread Wyatt Baldwin
On Thursday, February 7, 2013 7:32:00 AM UTC-8, Jonathan Vanasco wrote: what are you using to manage sql connections in your app ? Forgot to mention that I'm using a slightly modified version of Beaker's ext:database back end, but when I switch to the stock ext:database back end, the issue

add_request_method vs custom request factory

2013-02-06 Thread Wyatt Baldwin
The docs say config.add_request_method() is the recommended method for extending the request object and should be used in favor of providing a custom request factory via pyramid.config.Configurator.set_request_factory() but doesn't say why (or at least not that I could find). Does anyone have

Moving from Beaker SessionMiddleware to pyramid_beaker

2013-02-06 Thread Wyatt Baldwin
I'm in the process of migrating a Pylons app to Pyramid. It uses a SQLAlchemy/MySQL back end for sessions (the session DB is separate from the main app DB). I swapped out Beaker's SessionMiddleware with a pyramid_beaker session factory. This seems like a straightforward transformation, and

Re: add_request_method vs custom request factory

2013-02-06 Thread Wyatt Baldwin
mechanism. On Wed, Feb 6, 2013 at 3:15 PM, Wyatt Baldwin wyatt.le...@gmail.comjavascript: wrote: The docs say config.add_request_method() is the recommended method for extending the request object and should be used in favor of providing a custom request factory via

Re: Calling get_current_registry() during Pyramid startup

2013-01-29 Thread Wyatt Baldwin
On Tuesday, January 29, 2013 12:24:53 AM UTC-8, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I have a method def notify(text): settings = pyramid.threadlocal.get_current_registry().settings host = settings.get() which works fine when called from a

Re: Accessing INI configuration from within Pyramid

2013-01-17 Thread Wyatt Baldwin
On Thursday, January 17, 2013 3:25:15 AM UTC-8, Andreas Jung wrote: I added some extra app specific sections to the ini file of my Pyramid application. How can I get hold of the settings from within my app (pyramid.config)? Pyramid doesn't automatically parse settings. You can use the

Re: Accessing INI configuration from within Pyramid

2013-01-17 Thread Wyatt Baldwin
On Thursday, January 17, 2013 9:11:51 AM UTC-8, Chris McDonough wrote: On Thu, 2013-01-17 at 09:04 -0800, Wyatt Baldwin wrote: On Thursday, January 17, 2013 3:25:15 AM UTC-8, Andreas Jung wrote: I added some extra app specific sections to the ini file of my Pyramid

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Wyatt Baldwin
On Tuesday, January 15, 2013 4:00:09 AM UTC-8, Andreas Jung wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Let's assume that we have a Pyramid site with several functional sections. As part of maintenance operations you want to disable a parts of the site e.g. by disallowing all

Re: how to build up a pyramid resource tree for a traversal based application that is available during whole application runtime

2013-01-15 Thread Wyatt Baldwin
On Tuesday, January 15, 2013 4:39:50 AM UTC-8, Sascha Gottfried wrote: Hello group, I am looking for a way to build up and keep my domain model in memory during pyramid serves my application. This time I do not want to use a SQL database or ZODB as the persistence layer. I currently

Re: wake of the RoR sql injection vulnerability

2013-01-09 Thread Wyatt Baldwin
On Wednesday, January 9, 2013 11:16:40 AM UTC-8, malthe wrote: On 9 January 2013 18:14, Chris McDonough chr...@plope.com javascript: wrote: The most recent vulnerability ( https://groups.google.com/forum/?fromgroups=#! topic/rubyonrails-security/61bkgvnSGTQ ) might allow for SQL

Re: pyrmid logging

2013-01-03 Thread Wyatt Baldwin
On Thursday, January 3, 2013 8:48:19 AM UTC-8, cropr wrote: Does anyone know if is is possible to make pyramid putting its log messages no longer in the 'application' logger, but in a different one, preferable in a 'pyramid' logger, or in the root logger. When I set the loglevel in my

Re: pyrmid logging

2013-01-03 Thread Wyatt Baldwin
On Thursday, January 3, 2013 12:15:04 PM UTC-8, cropr wrote: Wouldn't the configuration be the same as in Pylons? In Pylons you had in the logging section of the development.ini file a pylons logger defined, that was used by the code in the pylons framework. AFAIK there is no such

Re: Scam-proof pageviews with Pyramid?

2012-12-16 Thread Wyatt Baldwin
On Sunday, December 16, 2012 1:25:36 PM UTC-8, Zak wrote: I want keep a count of page views for each page of my Pyramid app. What's the best way to do this? Do I need to use my database to store the number or does Pyramid have a caching framework that would be simpler? How can I block

Re: get a parameter when clicked a link

2012-12-14 Thread Wyatt Baldwin
On Friday, December 14, 2012 11:11:08 AM UTC-8, Auston Jary wrote: Hi everyone, i'm a new web developer,so i don't know if it's the right place to ask this question :( i recently use pyramid/sqlachemy/mako write a web now have a problem if a have a link list like user1 user2

Re: view_config to register a url to a view

2012-12-04 Thread Wyatt Baldwin
On Thursday, November 22, 2012 12:15:09 AM UTC-8, Chris Withers wrote: Hi All, I may be imagining this, but in previous versions, was there a way to do: @view_config(blah='/some/url.html') def my_view(request): ... In any case, is there any way I can do that now, without calling

Re: configuration and registries

2012-03-30 Thread Wyatt Baldwin
On Friday, March 30, 2012 2:28:35 AM UTC-7, Chris McDonough wrote: On Fri, 2012-03-30 at 09:09 +0100, Chris Withers wrote: Can the registry be used for simple key value pairs or is it only for component registrations? pyramid.registry.Registry (the default registry type) indeed

Re: anyone have a suggestion to do per-environment package 'constants' ?

2012-03-25 Thread Wyatt Baldwin
On Sunday, March 25, 2012 9:12:30 PM UTC-7, Jonathan Vanasco wrote: 99% of my per-environment setups are handled in the .ini file, and available via the registry stash I have a few 'variables' that I need defined within a package scope, as I'm not going to have a request or event object

Re: Cleaning up files generated for user session

2012-02-10 Thread Wyatt Baldwin
Do you need to save temp files at all? Are the PNGs expensive to generate in R? Can you request raw bytes from R instead of saving to file? I have a scenario that's similar to yours (not using R, though; I'm generating audio files), and I stream the bytes generated by the back end directly to

Re: need your help to overhaul docs

2012-02-05 Thread Wyatt Baldwin
I'll commit to $100. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the web visit https://groups.google.com/d/msg/pylons-discuss/-/Ct3kw0v6GfIJ. To post to this group, send email to pylons-discuss@googlegroups.com.

Re: How to change paths to static assets in .css files?

2012-01-07 Thread Wyatt Baldwin
On Saturday, January 7, 2012 8:28:46 AM UTC-8, Craig Younkins wrote: For our site we actually have a build process for our CSS templates at application start. This way we can have different domains depending on the configuration (testing, prod, dev), and it all works with the same

Re: How to change paths to static assets in .css files?

2012-01-05 Thread Wyatt Baldwin
On Thursday, January 5, 2012 1:24:21 PM UTC-8, Thomi wrote: Hi, I'm working on a pylons project, and we have users trying to host the web-app under a non-root path (i.e. host it at '/myapp/' rather than at '/'). We've been pretty good about using 'h.url_for' to generate links in our

Re: SQLAHelper 1.0 released, and a proposal

2011-12-28 Thread Wyatt Baldwin
On Wednesday, December 28, 2011 8:52:37 AM UTC-8, mike bayer wrote: [...] Also note ticket 2338: http://www.sqlalchemy.org/trac/ticket/2338 , which I'm leaning towards, would add the full module path of things to the registry, so you could say: group = relationship(myauth.classes.Group)

Re: SQLAHelper 1.0 released, and a proposal

2011-12-28 Thread Wyatt Baldwin
On Wednesday, December 28, 2011 12:28:06 PM UTC-8, Mike Orr wrote: [...] Does anyone know of a better name than 'sqlahelper'? helper does seem a bit broad and not particularly descriptive (no offense). I.e., what exactly is it helping me to do? The only alternative I can think of is hub, as

Re: Cornice 0.6 released

2011-12-23 Thread Wyatt Baldwin
On Wednesday, December 21, 2011 2:59:01 PM UTC-8, Gael Pasgrimaud wrote: On Wed, Dec 21, 2011 at 11:18 PM, Tarek Ziadé ziade...@gmail.com wrote: On Wed, Dec 21, 2011 at 11:00 PM, Gael Pasgrimaud ga...@gawel.org wrote: Hi, On Wed, Dec 21, 2011 at 11:24 AM, Tarek Ziadé

Re: Serving Dynamic/Template js files

2011-12-21 Thread Wyatt Baldwin
On Wednesday, December 21, 2011 3:28:25 AM UTC-8, Marius Gedminas wrote: On Tue, Dec 20, 2011 at 09:07:58AM -0800, Wyatt Baldwin wrote: In an earlier version of my code, I did some dynamic JavaScript configuration using Mako constructs: # app.mako script

Re: Serving Dynamic/Template js files

2011-12-20 Thread Wyatt Baldwin
if it is better to be able to serve these small snippets as separate js files rather than inline, so that they get loaded even if downloaded via AJAX. I guess then I will have to assign a special view/route to these dynamic snippets, and render via a template. Ahmed On Dec 19, 9:32 am, Wyatt Baldwin

Re: Serving Dynamic/Template js files

2011-12-18 Thread Wyatt Baldwin
On Sunday, December 18, 2011 9:39:28 AM UTC-8, Chris Rossi wrote: On Sun, Dec 18, 2011 at 7:55 AM, Ahmed ahmed...@gmail.com wrote: I wonder what is the best practice for my case? And if using a template renderer is the best solution, how is that best made? For example is the Chameleon text

Re: Fetching registry (settings) outside of the view

2011-12-01 Thread Wyatt Baldwin
On Thursday, December 1, 2011 5:00:53 PM UTC-8, Iain Duncan wrote: [...] We're using the zca as the way our components interact, by instantiating them inside adapters of request, context, and sometimes view. This is still being done using the registry attached to request, so it's not the

Re: Production.ini

2011-11-30 Thread Wyatt Baldwin
On Wednesday, November 30, 2011 8:49:47 AM UTC-8, Jonathan Vanasco wrote: You may be over-thinking this. The only good reason I've encountered to not have the passwords within the codebase, is worries of : 1. a web config makes the file viewable as plaintext 2. a web config makes the

Re: cleaning up after a request, always?

2011-11-21 Thread Wyatt Baldwin
How come you guys aren't using ZopeTransactionExtension for this , i.e. http://docs.pylonsproject.org/projects/pyramid/en/1.2-branch/tutorials/wiki2/basiclayout.html#content-models-with-models-py? My understanding is that session scope should be entirely handled in that case. I'm

Re: cleaning up after a request, always?

2011-11-20 Thread Wyatt Baldwin
On Sunday, November 20, 2011 3:17:54 PM UTC-8, Iain Duncan wrote: On Sun, Nov 20, 2011 at 2:48 PM, Iain Duncan iaindun...@gmail.com wrote: Hey folks, I'm using the pattern of making sqlalchemy sessions in a request factory, but I've mucked up and the session's aren't always getting close.

Re: pyramid override_asset and mako template lookup

2011-11-04 Thread Wyatt Baldwin
I had some issues with this in Pyramid 1.1 and also found it to be counter-intuitive (see herehttps://groups.google.com/forum/#%21topic/pylons-discuss/-RjHhmI-O3c/discussion), but my thinking was opposite yours with regard to how asset overrides should be applied to `mako.directories`. In

Re: Apache permissions problems deploying Pyramid

2011-10-06 Thread Wyatt Baldwin
This is what my typical mod_wsgi config looks like: WSGIDaemonProcess myapp user=wyatt home=/home/wyatt/envs/mayapp display-name=myapp WSGIScriptAlias /myapp /home/wyatt/envs/myapp/bin/app.wsgi Location /myapp WSGIProcessGroup myapp /Location Maybe you need to add a Location section? Also,

Re: Transfer request to HTTPFound

2011-09-29 Thread Wyatt Baldwin
I'm not sure I follow this exactly, but could you create a template fragment (a %def in Mako) that contains the form and then call it with the differentiating args? Something like this: %def name=make_form(action, submit_value) form method=POST action=${action} !-- form controls

Re: Composite application configuration

2011-09-07 Thread Wyatt Baldwin
On Tuesday, September 6, 2011 10:27:56 AM UTC-7, Jason wrote: [...] This is what I am now doing, but slightly different. In the main(global_config, **settings): settings.update(global_config) and then if I want to override something that is in [DEFAULT] I use: [DEFAULT] x = 1

Re: Composite application configuration

2011-09-07 Thread Wyatt Baldwin
On Wednesday, September 7, 2011 9:21:23 AM UTC-7, Jason wrote: On Wednesday, September 7, 2011 11:33:47 AM UTC-4, Wyatt wrote: I noted this in one of my earlier posts (re: set). Also, the way you're updating the settings dict with global_conf will overwrite your app config, won't it? I'm

Re: Composite application configuration

2011-09-07 Thread Wyatt Baldwin
On Wednesday, September 7, 2011 9:52:27 AM UTC-7, Michael Merickel wrote: Apologies for not following most of the conversation, but just thought I'd mention that in the past I've done: def main(global_conf, **app_settings): settings = global_conf.copy()

Re: Composite application configuration

2011-09-01 Thread Wyatt Baldwin
I think what the OP wanted to do was more like this: [common-app-settings] x = 1 y = 2 z = 3 [app:app1] use = egg:SomeEgg # include common-app-settings [app:app2] use = egg:AnotherEgg # include common-app-settings -- You received this message because you are subscribed to the Google Groups

Re: Composite application configuration

2011-09-01 Thread Wyatt Baldwin
I'm using the [DEFAULT] section for this type of thing, but it's a bit wonky IMO and doesn't seem to fit with PasteDeploy's world view. I wish there was an easy way to inherit or mixin config from another section *in the same config file* (yes, I could use `use` to inherit config from another

Re: Composite application configuration

2011-09-01 Thread Wyatt Baldwin
It should work the same way in Pyramid or Pylons, since they both use PasteDeploy to parse and interpret the config file. My config looks something like this: [DEFAULT] x = 1 [app:app1] use = egg:MyEgg # this should inherit x # If you want to override the global x, you have to use `set` (which

Re: Pyramid handlers: authorization for entire handler action

2011-08-14 Thread Wyatt Baldwin
As of pyramid_handlers 0.2, you should be able to set the default permission for a handler like this: config.add_handler(..., view_permission='authenticated') -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To view this discussion on the

Re: Interpackage Mako inheritance in Pyramid 1.1 vs 1.0

2011-08-01 Thread Wyatt Baldwin
On Saturday, July 30, 2011 12:54:03 PM UTC-7, Wyatt Baldwin wrote: With Pyramid 1.0, I could inherit from a template in another package using the standard Mako syntax: # Paste config file: mako.directories = package_A:templates pacakge_B:templates # templates/layout.mako in package_A

Interpackage Mako inheritance in Pyramid 1.1 vs 1.0

2011-07-30 Thread Wyatt Baldwin
With Pyramid 1.0, I could inherit from a template in another package using the standard Mako syntax: # Paste config file: mako.directories = package_A:templates pacakge_B:templates # templates/layout.mako in package_A html ... /html # templates/app.mako in package_B inherit

Re: pylons url_for doesn't yield proper internal static. SCRIPT_NAME is not inserted into the resolved URL

2011-07-14 Thread Wyatt Baldwin
I don't know if this will help, but the preferred way to generate URLs is to use `pylons.url()`. It's available automatically in templates, so you can replace `${h.url_for('xyz')}` with `${url('xyz')}`. -- You received this message because you are subscribed to the Google Groups

Re: sqlalchemy version in pylons 1.0

2011-06-16 Thread Wyatt Baldwin
On Thursday, June 16, 2011 10:13:57 AM UTC-7, monax wrote: Hello! What problem can I have if I will use sqlalchemy version 0.7 with pylons 1.0? Pylons 1.0 uses sqlalchemy version 0.5 by default. Pylons doesn't depend on SQLAlchemy, so there shouldn't be any problems at all. When you

Re: access to toplevel app and internal dispatch

2011-06-02 Thread Wyatt Baldwin
I posted a question about this once, which I can't find now. The gist of the solution I came up with was to create a pipeline where a simple WSGI app would always be called first and save a reference to itself in the environment. -- You received this message because you are subscribed to the

Re: URL path changes needed to static files

2011-05-25 Thread Wyatt Baldwin
On Wednesday, May 25, 2011 5:51:15 AM UTC-7, Geoff wrote: Sorry, I didn't see you were using Pylons 1.0, so my answer is actually useless. Actually your answer is proving to be very useful, it got me thinking about the pylons routes dispatcher which is an area of pylons to which I

Re: URL path changes needed to static files

2011-05-25 Thread Wyatt Baldwin
On Wednesday, May 25, 2011 12:40:30 PM UTC-7, Geoff wrote: On May 25, 5:16 pm, Wyatt Baldwin wyatt.le...@gmail.com wrote: On Wednesday, May 25, 2011 5:51:15 AM UTC-7, Geoff wrote: In your templates, use the `pylons.url` function to generate URLs: ${url('/css/blah.css

Any plans for an official Genshi renderer?

2011-05-21 Thread Wyatt Baldwin
Are there any plans for an official pyramid_genshi package? I couldn't find much info about using Genshi with Pyramid, and I'm curious as to why that is. One thing I did find is this pyramid_genshi project on GitHub:

Re: Porting a restcontroller from pylons 1.0 to pyramid?

2011-05-15 Thread Wyatt Baldwin
On Sunday, May 15, 2011 1:33:28 AM UTC-7, He Shiming wrote: Hi, I'm trying to port some restcontroller written in pylons 1.0 to pyramid. [snip] I'm wondering if there are any tutorials on this? Or is there a sample project I can consult? Thanks. This post might be helpful:

Re: Many DB calls when using user obj as a request attribute pattern

2011-04-17 Thread Wyatt Baldwin
Where is the code that calls `request.user`? It sounds you are calling it unconditionally on *every* request. -- 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

Re: c object to javascript

2011-03-20 Thread Wyatt Baldwin
On Sunday, March 20, 2011 11:46:10 AM UTC-7, gazza wrote: Hiya, I want to pass a c object to a javascript onLoad function. How can I do this, if at all? What I do is something like this: In controller action: c.thing = thing In Mako template: script var thing =

Re: c object to javascript

2011-03-20 Thread Wyatt Baldwin
The NameError is probably because you didn't add `import json` to the top of your helpers module. You will also need to import the `literal` from WebHelpers. On the JavaScript side, I actually would not recommend using the JSON object directly, because it's not supported by all browsers.

Re: JSON.stringify issue in web ob

2011-03-09 Thread Wyatt Baldwin
On Wednesday, March 9, 2011 4:51:54 AM UTC-8, cropr wrote: I am sending a JSON encoded POST parameter, using the javascript function JSON.stringify, to the pylons application and I am getting strange webobi behaviour. If is send '{arg: this is a string}' everything works fine If is send

[Pyramid] Attach SQLAlchemy Session to settings object instead of creating module global?

2011-02-24 Thread Wyatt Baldwin
In Pylons, there's a recommended SQLAlchemy setup where the Session is created as a module global and then configured by a call to a function in the model package. I've been using a variation of this setup in my Pylons apps, but as I've been porting to Pyramid, I've been thinking it would be

Pylons/Pyramid hybrid?

2011-02-16 Thread Wyatt Baldwin
I would like to move from Pylons 1.0 to Pyramid, but I'm not going to be able manage a wholesale port any time soon. So, I'm wondering if it would be practical to start using some parts of Pyramid within an existing Pylons project. In particular, one of the problems I'm having with Pylons is

Re: Pylons/Pyramid hybrid?

2011-02-16 Thread Wyatt Baldwin
On Wednesday, February 16, 2011 12:34:23 PM UTC-8, Chris McDonough wrote: On Wed, 2011-02-16 at 12:09 -0800, Wyatt Baldwin wrote: I would like to move from Pylons 1.0 to Pyramid, but I'm not going to be able manage a wholesale port any time soon. So, I'm wondering if it would be practical

Re: Noob Question: REST App Server ...

2011-02-11 Thread Wyatt Baldwin
Has someone else implemented a thin REST app server in Pylons? The short answer is: Yes. Basically, just trim the middleware to suit your needs, just leaving Routes and whatever else you might need. I can post up an example later. -- You received this message because you are subscribed to

Re: Noob Question: REST App Server ...

2011-02-11 Thread Wyatt Baldwin
Here's an untested minimal setup for Pylons minus a few details (like imports). Throw in a config file, and this about all you need. I'd be interested in seeing an equivalent Pyramid setup. # config/middleware.py def make_app(global_conf, full_stack=True, **app_conf): config =

Re: How to access Paster/ini configuration in models/test scripts

2011-02-01 Thread Wyatt Baldwin
On Tuesday, February 1, 2011 4:03:13 PM UTC-8, Ryan wrote: I'm aware that request.environ['paste.config'] will return configuration settings from whichever .ini is being utilized, in a view. How can I access the Paster configuration from a model or test script? I would recommend that you

Re: make all url calls qualified=True

2011-01-31 Thread Wyatt Baldwin
You could add a `url` function to your helpers module that wraps `pylons.url`: import pylons def url(*args, **kwargs): kwargs.setdefault(qualified=True) return pylons.url(*args, **kwargs) And then use `h.url` instead of `url` in your templates. -- You received this

Re: Repoze.what and Pylons

2011-01-05 Thread Wyatt Baldwin
We might need to see some code to give you an answer. My first thought is: what is the order of your middleware in middleware.py. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to

Re: Issue with mod_wsgi and repoze.what

2010-12-19 Thread Wyatt Baldwin
On Dec 19, 10:22 pm, lollerskates gmsu...@gmail.com wrote: I'm having a bizarre issue with mod_wsgi and repoze.what. My project pretty much works except for auth. I set it up with repoze.what.plugins.quickstart.setup_sql_auth (with sqlalchemy) and / login_handler calls when I try to login

How do you deal with the trailing slash problem when deploying with mod_wsgi?

2010-12-15 Thread Wyatt Baldwin
In an Apache VirtualHost, I have some mod_wsgi configuration that looks like this for a handful of apps: WSGIDaemonProcess acid user=me group=cooldoods display-name=acid WSGIScriptAlias /app/acid /somewhere/acid/parts/wsgi_app/wsgi Location /app/acid WSGIProcessGroup acid

Re: Problem initiating virtualenv in Fedora

2010-12-06 Thread Wyatt Baldwin
On Dec 6, 11:24 am, lolcoder2000 lolcoderz2...@gmail.com wrote: It looks like you've installed Python in your home directory. Nope /usr/bin.  Did you compile it yourself? What commands did you use?  Package install via the OS.  Er Probably yum install python. In any case, it looks like

Re: Beginner question - Help with Pylons MVC

2010-11-11 Thread Wyatt Baldwin
On Nov 10, 10:19 pm, Andrew legend.z...@gmail.com wrote: Hi, I'm currently learning pylons (and python) and would like some help on a project, I believe I have the right approach but I am not sure of how the MVC would be structured. ==What I am trying to do== Let me explain a bit more of

Re: Beginner question - Help with Pylons MVC

2010-11-11 Thread Wyatt Baldwin
On Nov 11, 12:38 am, Jan Koprowski jan.koprow...@gmail.com wrote: On Thu, Nov 11, 2010 at 7:19 AM, Andrew legend.z...@gmail.com wrote: Hi, I'm currently learning pylons (and python) and would like some help on a project, I believe I have the right approach but I am not sure of how the

Re: does explicit conversion required for utf-8 in mako?

2010-10-20 Thread Wyatt Baldwin
On Oct 20, 3:16 am, rsoares botequi...@gmail.com wrote: Hi, Try put the following line on the top of every mako file (or the parent file, if you are using template inheritance): # -*- coding: utf-8 -*- I think this should help rendering utf-8 content. If I'm not mistaken, the purpose of

Re: templ_context / c variable getting reset after first request

2010-10-06 Thread Wyatt Baldwin
On Oct 6, 8:42 am, Matt H matt2...@gmail.com wrote: Hi. I'm trying to set an attribute on c from a decorator, like so: def dec1():     def wrap_fn(f):         c.msg = 'hi'         return f     return wrap_fn @dec1 def create(self):    return render('create_tmpl') Doesn't `dec1` need

Re: TypeError: No object (name: url) has been registered for this thread

2010-09-21 Thread Wyatt Baldwin
On Sep 21, 6:18 am, grassoalvaro grassoalv...@yahoo.com wrote: Hi, i have a little problem with paster setup-app. Here's some code: [code] from pylons import url from pylons.decorators.secure import https class AccountPlugin(Plugin):     @https(url('/logowanie/',

Re: Routes collection mapped controller

2010-09-11 Thread Wyatt Baldwin
On Sep 10, 3:41 pm, waugust waugustyn...@gmail.com wrote: This is driving me nuts.. I have a route mapped as an extra collection on a resource: maps.resource('post', 'posts', collection={'json':'GET'}) The controller action: @jsonify def json(self):  q = sa.query(Post)         count =

Re: Routes collection mapped controller

2010-09-11 Thread Wyatt Baldwin
reports it appropriately as well. On Sat, Sep 11, 2010 at 5:45 PM, Wyatt Baldwin wyatt.lee.bald...@gmail.comwrote: I'm not really sure what's going on there, but when you use map.resource, you can do this instead of adding a special `json` action:    GET /post/1.json Then 'json

Re: Formencode 1.2.2 UnicodeEncodeError

2010-09-03 Thread Wyatt Baldwin
On Sep 3, 12:36 am, mileako mile...@gmail.com wrote: Hi, Put the code in a script and run it, and hopefully the traceback will show exactly which statement raised the exception. I'm guessing it was raw_input() before the validator was even called. It's a same problem. Other code prompt

Re: repoze.what, repoze.who with pylons

2010-08-22 Thread Wyatt Baldwin
On Aug 22, 6:42 am, Jonathon Anderson anderbub...@gmail.com wrote: I have a pylons app using repoze.what+repoze.who for auth^2.  The RedirectingFormPlugin in repoze.who middleware wants to know the login and logout urls for automatic redirection (login_form_url, login_handler_path, and

Re: Dynamically adding controllers

2010-08-20 Thread Wyatt Baldwin
On Aug 20, 12:45 am, Jurie-Jan Botha juriejanbo...@gmail.com wrote: This Routes syntax might work for you: map.connect('/some/test/path', controller='myproject.tests.controllers:MyController') This doesn't seem to work at all. Was this included in a specific version of routes or

Re: how to use tmpl_context inside a javascript function?

2010-08-20 Thread Wyatt Baldwin
On Aug 19, 10:45 pm, Krishnakant Mane krm...@gmail.com wrote: On Friday 20 August 2010 04:20 AM, Wyatt Baldwin wrote: You can put Mako/JS templates in your templates directory and then render them from your HTML template with something likescript src=$ {url('/templates/javascripts

Re: Optimizations for production

2010-08-20 Thread Wyatt Baldwin
On Aug 20, 2:29 am, Jens Hoffrichter jens.hoffrich...@gmail.com wrote: Hi everyone, As this mailing list has proved very proficient in the past in helping with my problems, I thought you could help me now by brain storming for more optimizations on our production site here. I have done all

Re: Authentication and Authorization.

2010-08-20 Thread Wyatt Baldwin
On Aug 20, 7:33 am, Dobrysmak lukasz.szyman...@gmail.com wrote: Hi guys. What is a good and easy to use authentication/authorization module for Pylons? Just found out that the AuthKit no longer being maintained (http:// wiki.pylonshq.com/display/authkitcookbook/Home) plus it's to

Re: pylons.config doesn't seem to care about config... at all

2010-08-19 Thread Wyatt Baldwin
On Aug 14, 8:13 am, Peter Hartmann mailbox@gmail.com wrote: Hello there, truth is, I was not using Pylons since 0.9.7, but this piece of documentation still seems relevant: http://pylonshq.com/docs/en/1.0/configuration/#getting-information-fr... So I have an auth.py file in /config

Re: TurboMail 3 with Pylons 1.0 - MailNotEnabledException

2010-08-19 Thread Wyatt Baldwin
On Aug 18, 9:31 pm, karikris...@gmail.com karikris...@gmail.com wrote: try this in your config/environment.py's at the END of load_environment function     pylons.config.update(config)     tm_pylons.start_extension() without update, the recent pylons doens't work for me, too. Another other

Re: Groovie URL generation with absolute URLs

2010-08-19 Thread Wyatt Baldwin
On Aug 19, 11:27 am, Ryan ryan.mckil...@gmail.com wrote: For URL generation in email templates, I need absolute (e.g.http://mysitename/path) URLs, not relative (e.g. /path). How is this done? According to the docs, there's a `host` keyword arg for overriding the default host. I don't want

Re: how to use tmpl_context inside a javascript function?

2010-08-19 Thread Wyatt Baldwin
On Aug 19, 12:39 pm, Eric Rasmussen ericrasmus...@gmail.com wrote: Hi Krishnakant, I'm not sure if this is exactly what you're asking, but what I've done before is use scripting in the template to build up a Javascript array. For instance:

Re: how to use tmpl_context inside a javascript function?

2010-08-19 Thread Wyatt Baldwin
On Aug 19, 11:45 am, Krishnakant Mane krm...@gmail.com wrote: Hello, Might be this is too easy and I am overlooking some simple solution. But really, I am not finding a way to include a value from tmpl_context inside a javascript function. what if I am creating a form that will have

Re: application config variables

2010-08-19 Thread Wyatt Baldwin
On Aug 19, 1:07 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote: On Aug 19, 11:23 am, Ryan ryan.mckil...@gmail.com wrote: I'm utilizing my various environment .ini files to set application configuration where the config in question differs from env to env (e.g. Authorize.net testing

Re: SQLAlchemy, Multiple Engines and Threading

2010-08-18 Thread Wyatt Baldwin
On Aug 14, 11:34 am, Myx myxpyxy...@hotmail.com wrote: Greetings fellow Pyloneers! I have started to encounter a quite annoying problem while working on my current project: The results from database querys are different from thread to thread. My project is a server for a flash game, the

URLs in JavaScript files

2010-08-17 Thread Wyatt Baldwin
I'm wondering if anyone has any good ideas on how to generate URLs in JavaScript code that take into account the application's URL prefix. What I've done is implement a couple of JS helpers to sort-of mimic `pylons.url`, and this seems to work pretty well. In my Mako template, I do this: script

  1   2   3   4   >