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

2012-03-27 Thread Jonathan Vanasco
at this point you're just asking for ways to deal with this in Python. On Mon, Mar 26, 2012 at 12:48 PM, Jonathan Vanasco jonat...@findmeon.comwrote: those work at runtime , but I'm trying to define something on the app init e.g. lib/constants.py

Re: Building Separate Front-End for Mobile and Computer

2012-03-27 Thread Jonathan Vanasco
Do you mean a JSON web API? If so , sounds like you're talking about a Service Oriented Architecture. To be honest, the *easiest* JSON APIs i've ever written were in Pylons/ Pyramid. You have full control of the request, and all you need to do is return a dict from a view/handler that is

Re: is it safe to store data on handlers/views in self, or should it be self.request ?

2012-03-27 Thread Jonathan Vanasco
FWIW, I started working on this approach a few weeks ago, and have been loving it. I attach two Pylons-style Attribute-Safe objects onto the request at init : request.app_meta request.workspace app_meta contains stuff like is the user logged in? , timestamp / datetimes for the request,

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

2012-03-26 Thread Jonathan Vanasco
those work at runtime , but I'm trying to define something on the app init e.g. lib/constants.py if PRODUCTION_MACHINE : VAR_1 = '123' VAR_2 = '123' elif DEV_MACHINE : VAR_1 = '456' VAR_2 = '456' this is, of course, an

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

2012-03-25 Thread Jonathan Vanasco
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 handy. I put variables in quotes, because they're more like constants in

catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
I'm using pyramid and SqlAlchemy, but not pyramid_tm. If the server is down, the following exception is raised: sqlalchemy.exc.OperationalError I'm wondering how i can best catch this , so i can handle internal alerts and possibly change the response. the only thing available in a

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
should be populated (at least on 1.3+), so you could deal with that in a NewResponse subscriber if necessary. On Wed, Mar 21, 2012 at 12:10 PM, Jonathan Vanasco jonat...@findmeon.comwrote: I'm using pyramid and SqlAlchemy, but not pyramid_tm. If the server is down, the following

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
On Mar 21, 2:11 pm, Michael Merickel mmeri...@gmail.com wrote: The only way a NewResponse subscriber would be invoked *after* an exception occured is if you are handling the exception in an exception view. If that's the case, then you are rendering a new view and as part of the rendering,

Re: catching sqlalchemy exceptions

2012-03-21 Thread Jonathan Vanasco
https://github.com/jvanasco/pyramid_exceptionstest If you hit /hello_world it raises a ValueError. There is no Exception View configured for ValueError. The NewResponse subscriber catches it. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To

Re: Plugins, in general

2012-03-20 Thread Jonathan Vanasco
added 11 of my packages. On Mar 19, 4:03 pm, Michael Merickel mmeri...@gmail.com wrote: http://pyramid.opencomparison.org/ This page has stagnated since Danny originally set it up and it would be wonderful if it could get some love. On Mon, Mar 19, 2012 at 2:16 PM, Mike Orr

Re: Plugin System for Pyramid? Howto?

2012-03-18 Thread Jonathan Vanasco
Someone more familiar will chime in with an expanded and better response , but I would look into these elements that I've encountered in the past few months: Pyramid has Event Subscribers: http://pyramid.readthedocs.org/en/latest/api/events.html There are also hooks

Re: Plugin System for Pyramid? Howto?

2012-03-18 Thread Jonathan Vanasco
On Mar 18, 12:07 pm, Chris McDonough chr...@plope.com wrote: You're probably going to want to investigate Pyramid's existing plugin system before creating another one: how did i miss that in the docs , but see everything else!?!? so excited for the forthcoming updated docs. -- You received

Re: Threadlocals? Globals?

2012-03-14 Thread Jonathan Vanasco
Depending on what Alice is - and how you plan on scaling your application - I would either store the object in Beaker ( perhaps with memcached ) or serialize the underlying data into a no-sql store like Riak or Mongo. -- You received this message because you are subscribed to the Google Groups

how are file uploads processed in deform / pryamid ?

2012-03-14 Thread Jonathan Vanasco
hey- because almost every python package around thumbnailing images and s3 support is tied to a framework (really?!?!) i'm porting an old package from proprietary to BSD license. right now it's handling file handles and fieldstorage ( from formencode ). i'd love to support the full pyramid

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-11 Thread Jonathan Vanasco
fyi, these were the changes i needed to make: 1. Pyramid - Enable Paste Prefix Middleware [app:main] filter-with = proxy-prefix [filter:proxy-prefix] use = egg:PasteDeploy#prefix 2. Nginx - Ensure proper headers location / { # Configure Proxy Pass

Re: Overriding (blocking) Set-Cookie per view

2012-03-10 Thread Jonathan Vanasco
off the top of my head, you could use a subscriber. you should be able to write something for NewResponse that strips whichever cookies you want. i wrote a package that does pretty much the exact opposite of what you want... https://github.com/jvanasco/pyramid_subscribers_cookiexfer that

anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
I'd like to limit certain operations to https , instead of http. The problem is that pyramid is often behind a front-end server , which is handling the http and https connections, and oblivious to the protocol. Does anyone have a good idea how to proceed ? The only thing I can think of is to

Pyramid Packages Demo

2012-03-10 Thread Jonathan Vanasco
Over the past few months, I've created about a dozen packages for use with pyramid and decided that I might as well start cobbling together a reference micro-application for them So far, I've begin integrating these 8 into an example application : * gaq_hub - centrally manages google

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
Hi Fabio- I do the same thing with cookies and the general setup. I wrote a library last week to handle encryption ( insecure_or_secure_enough ). My concern is how to know within Pyramid if the client downstream has connected within http or https. -- You received this message because you are

Re: anyone have an idea to discern if we're operating as https or not ?

2012-03-10 Thread Jonathan Vanasco
On Mar 10, 4:35 pm, Michael Merickel mmeri...@gmail.com wrote: With a properly configured server you can just check request.scheme in a predicate to determine if the request is over https. Awesome. As always, thanks! the exact answer i needed! -- You received this message because you are

Re: Pyramid in Production

2012-03-08 Thread Jonathan Vanasco
Not talking about Pyramid / WSGI layer itself... Assuming that these are just skinning a platform for customers, I would keep away from running each application on a separate IP and try to handle them via virtualhosts. The rationale for this is: 1. It's easier to step repeat for new clients 2.

Re: multiple beaker sessions under pyramid ?

2012-03-06 Thread Jonathan Vanasco
pyramid_subscribers_beaker_https_session https://github.com/jvanasco/pyramid_subscribers_beaker_https_session i've got it supporting two methods: 1. config.set_request_property 2. a NewRequest listener that manually sets the property the latter option is likely to leave, but i already named it

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
I'm close do doing this with a middleware hack. I looked into extending pyramid and pyramid_beaker to support a request.session_https option. That is going to add a chunk of code - so I should ask first... is that something worth doing ? -- You received this message because you are subscribed

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
the config.set_request_property sounds like it'll be *perfect* i'll whip up a distributable based on that -- will be much better than hacking at pyramid core! On Mar 5, 6:21 pm, Michael Merickel mmeri...@gmail.com wrote: On Thu, Mar 1, 2012 at 8:54 PM, Jonathan Vanasco jonat

Re: multiple beaker sessions under pyramid ?

2012-03-05 Thread Jonathan Vanasco
I've got a monkeypatched version that seems to work right now ( https://gist.github.com/1983280 ). It was the most straightforward way of compiling all the relevant pieces from Pyramid / Pyramid_Beaker. I say seems , because I don't have my local server setup to test with https, it works on port

Re: is there a facility in pyramid for sending/validating encrypted cookies ?

2012-03-01 Thread Jonathan Vanasco
ok, mostly ported over. https://github.com/jvanasco/insecure_but_secure_enough i'll have it on pypi shortly - having a pain with getting the distribution right while watching a puppy -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to

multiple beaker sessions under pyramid ?

2012-03-01 Thread Jonathan Vanasco
has anyone attempted this yet with pyramid_beaker , or a custom implementation ? much like the folks who asked about multiple beaker sessions under pylons [ http://groups.google.com/group/pylons-discuss/browse_thread/thread/62fbd23305db7dcc?fwc=1 ] , i'd like to have a beaker session for account

Re: is there a facility in pyramid for sending/validating encrypted cookies ?

2012-02-29 Thread Jonathan Vanasco
jargon. Pyramid doesn't ship with any encryption capabilities. b) See p.session.signed_serialize and p.session.signed_deserialize for signing a payload. http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/api/sess... On Tue, Feb 28, 2012 at 11:44 AM, Jonathan Vanasco jvana

is there a facility in pyramid for sending/validating encrypted cookies ?

2012-02-28 Thread Jonathan Vanasco
I didn't find anything in the docs, but I figured it would be worth asking. I am porting over a login system from Pylons. One of the elements has a cookie_autologin, which sets a 30day cookie if someone clicks remember me. the contents of the cookie are a lightweight payload + checksum. I

Re: Feedback request for custom scaffolding

2012-02-27 Thread Jonathan Vanasco
You should share the pypi and github links in the future. It makes it easy to dive in without installing first. http://pypi.python.org/pypi/pyramid_modern https://github.com/KamiQuasi/pyramid_modern -- You received this message because you are subscribed to the Google Groups pylons-discuss

Re: a question for anyone using formencode and pylons/pyramid ...

2012-02-24 Thread Jonathan Vanasco
Crhis- thanks. i'm on that list as well. this seems to be more of an 'implementation under pyrmaid' question than about how formencode works, which is why I asked here. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group,

Re: a question for anyone using formencode and pylons/pyramid ...

2012-02-24 Thread Jonathan Vanasco
also, thanks all. It seems like Pipe(Int(),OneOf()) is the 'right' option, as it'll get me the ints i want. cd34's suggestions were dead on and way better than my sleepless hack of string tempating ! -- You received this message because you are subscribed to the Google Groups pylons-discuss

Re: Repoze-dev subscription not working

2012-02-24 Thread Jonathan Vanasco
On Feb 24, 2:57 pm, Chris McDonough chr...@plope.com wrote: I don't know how to tell you to turn off the console output, either, sorry.  Have you tried reading the source code of Turbogears where it sets up the r.who stuff?  The repoze.who configuration stuff accepts a logger; apparently TG

Re: Repoze-dev subscription not working

2012-02-24 Thread Jonathan Vanasco
For debugging on a local machine, where there is a single page request and any concurrent requests come from static elements, it works perfectly. I wouldn't , and didn't , suggest that for production -- which also would also almost never have logging set to debug. -- You received this message

Re: Architecture of a backbone+pyramid single page app

2012-02-23 Thread Jonathan Vanasco
here's an example of the method i use... https://gist.github.com/1896363 it's tailored to using jquery, but not hard to change. 1. i set everything to have an 'rval' that will return - at the least - an error or success note. 2. i keep everything in a versioned API . these views map to /api/

Re: need your help to overhaul docs

2012-02-22 Thread Jonathan Vanasco
Just wanted to add to this discussion , for potential things to address in the docs: The security authorization/authentication stuff is a bit intense. At first glance, it looks and reads very much like an enterprise software type of system, with a lot of overhead. If I were building a CMS or a

a question for anyone using formencode and pylons/pyramid ...

2012-02-22 Thread Jonathan Vanasco
the request get/post data comes in from pyramid as unicode strings. the values i have in the database / my code for constant on many items are integers let's use this as an example... account_type_ids= (1,2,3,4,5) other_type_ids= (1,2,3,4,5) third_type_ids= (1,2,3,4,5) is there a

Re: creating an abstraction layer class to manage resources

2012-02-18 Thread Jonathan Vanasco
i tend to structure applications - python, php, whatever - like this: - I use multiple Database Handles. This is always at least a reader and a writer. On the database level, the reader is privileged to only select from databases, while the writer may read and write. If the application needs a

Re: creating an abstraction layer class to manage resources

2012-02-18 Thread Jonathan Vanasco
i personally wouldn' do that, because my SqlAlchemy classes are really just used for populating a read-only cache -- which is a dict -- and creating/editing records. in your case... and I'm just thinking out loud... 1. you could create an abstract class called CacheBacked, which your

pyramid_mailer and sendmail

2012-02-17 Thread Jonathan Vanasco
has anyone built something similar to pyramid_mailer that is compatible with sendmail ? pyramild_mailer seems to be a light wrapper around repoze_sendmail which, despite its name, has no support for sendmail. i just prefer to use sendmail for development work, as it requires no additional

Re: pyramid_mailer and sendmail

2012-02-17 Thread Jonathan Vanasco
thanks. i meant '/usr/bin/sendmail' as a wrapper to exim/postfix. does anyone even use the real sendmail anymore ? ;) I'll see if i can use it on localhost:25 . Years ago, that required a lot of wrangling on Macs to work - you had to set up accounts and all sorts of crap. it's probably

Re: Help with using the subprocess module in a Pylons controller

2012-02-17 Thread Jonathan Vanasco
how long does this create? if its longer than 'instantly', i'd move to a processing queue concept. -- 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

Re: Pyramid advocacy, list of high profile sites?

2012-02-15 Thread Jonathan Vanasco
i wrote a long response yesterday, and it seems it didn't post. f'ing google. The Pylons list is here: http://wiki.pylonshq.com/display/pylonscommunity/Sites+Using+Pylons For your purposes I would just talk about Pyramid being the new versions of Pylons. There are plenty of large sites in

Re: Pyramid: how to check browser cookies support

2012-02-15 Thread Jonathan Vanasco
there are a few things that could the cause of your problems. I'll repost on stack overflow. Before I continue... FYI Pyramid uses WebOb to handle request and response objects There's an overview here: http://docs.webob.org/en/latest/reference.html And class documentation here:

Re: what are the benefits of transaction and pyramid_tm / are they necessary ?

2012-02-15 Thread Jonathan Vanasco
database.commit() email.send() except: so I'm fine with the paradigm you're suggesting ;) On Feb 15, 1:26 pm, Mike Orr sluggos...@gmail.com wrote: On Wed, Feb 15, 2012 at 8:47 AM, Marius Gedminas mar...@gedmin.as wrote: On Tue, Feb 14, 2012 at 03:16:00PM -0800, Jonathan Vanasco wrote

Re: Distribution not found error

2012-02-15 Thread Jonathan Vanasco
did you run `setup.py develop` ? -- 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 pylons-discuss+unsubscr...@googlegroups.com.

Re: Akhet 2.0 released

2012-02-14 Thread Jonathan Vanasco
congrats! few comments. 1. it looks like you dropped pyramid_handlers -- any reason? 2. i think it would make sense to mark up demo/__init__.py more with comments to show what is going on. i remember having to reverse engineer some of the stuff that was happening in the earlier akhet, and

Re: van.static: Offloading static resources to a CDN

2012-02-14 Thread Jonathan Vanasco
this looks pretty neat. there are a few things I'm confused by. Exactly how is the switch handled on templates ? What configuration is needed on the app ? The approaches I've seen are either: 1- Some sort of post-processesing regex 2- Prepending static files with a cdn call. i.e. img

Is there a good idiomatic way to connect to a database on startup ?

2012-02-14 Thread Jonathan Vanasco
I typically use reflection under sqlalchemy, so my apps fail to start if there is any database issue. I'm working with declarative on a quick project, and wanted to know if there's a 'proper' way to ensure database connectivity on startup. -- You received this message because you are subscribed

what are the benefits of transaction and pyramid_tm / are they necessary ?

2012-02-14 Thread Jonathan Vanasco
I recently learned that pyramid_tm closes the session on a transaction.commit() I also learned that either transaction or pyramid_tm automatically commits at the end of a request I'm not comfortable with either of these behaviors, particularly the latter I've run into too many situations where

Re: writing unit tests that cover pylons and pyramid

2012-02-11 Thread Jonathan Vanasco
It's the same system virtualenv. it's just that 'using' the package seems to work fine, but testing it fails. c is exported in pylons , but that double assignment line seems to not define it via an import. i guess there's some pylons bootstrap code that needs to be run. in any event, based on

Re: writing unit tests that cover pylons and pyramid

2012-02-11 Thread Jonathan Vanasco
actually, screw that. unit testing for a series of helper wrappers is too difficult in pylons. pyramid and 'core' usage gets covered. pylons doesn't. now i'm going to brunch! -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this

writing unit tests that cover pylons and pyramid

2012-02-10 Thread Jonathan Vanasco
my tests keep failing on pylons packages. actually, i can't even run the tests. i've traced the error to this being in my packages: from pylons import c works fine in production, but not in testing looking at pylons/__init__.py, i see this line: tmpl_context = c =

Re: Cleaning up files generated for user session

2012-02-08 Thread Jonathan Vanasco
I've done something similar in the past. 1. I suggest expanding the logic a bit- log the filename , along with timestamp and session id 2. have a cronjob that deletes files associated with sessions that were last used outside a given window session cleanups within an app tend to only happen if

Re: SetCookie on redirect

2012-02-08 Thread Jonathan Vanasco
thanks. i ended up writing a quick subscriber package: https://gist.github.com/1771046 it supports two methods: 1- migrates headers into the redirect ( I opted to use .extend instead of merge_cookies, because i already had to pull the cookie data ) 2- stashes the cookies into a @cookie-xfer

does anyone know how to test if we're in a 'static' view or route ?

2012-02-08 Thread Jonathan Vanasco
i've got some debugging info on event subscribers; i'd like keep them from running on the static elements / debug toolbar, 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.

Re: does anyone know how to test if we're in a 'static' view or route ?

2012-02-08 Thread Jonathan Vanasco
thanks! On Feb 8, 1:45 pm, Chris McDonough chr...@plope.com wrote: On Wed, 2012-02-08 at 10:32 -0800, Jonathan Vanasco wrote: i've got some debugging info on event subscribers; i'd like keep them from running on the static elements / debug toolbar, etc The view isn't yet found when

Re: SetCookie on redirect

2012-02-08 Thread Jonathan Vanasco
wanted to add to this thread: after a lot of testing, I've noted that my 'cleanup' subscriber solution only works if you RETURN the HTTPFound. If you raise an HTTPFound, there's no way to catch the original request object it appears that event.request.response is overwritten with a new instance

Re: deform: is it possible to invalidate a form / field manually ?

2012-02-08 Thread Jonathan Vanasco
thanks eric. that is what i'm talking about! i've got my version working with formencode. in addition to the gist above, i decided to just go ahead and set up pyramid_formencode_classic on pypi and github ( https://github.com/jvanasco/pyramid_formencode_classic ) if i have some time this

Re: Raising 403 within traversal when the Forbidden context is already used to show the login page

2012-02-08 Thread Jonathan Vanasco
i don't use traversal... but can't you just use an httpexception? http://readthedocs.org/docs/pyramid/en/1.0-branch/api/httpexceptions.html class HTTPForbidden(detail=None, headers=None, comment=None, body_template=None, **kw) subclass of HTTPClientError This indicates that the

Re: deform: is it possible to invalidate a form / field manually ?

2012-02-08 Thread Jonathan Vanasco
actually, the param_source should support: GET POST params (GET POST) the idiomatic example would be an email verification routine- someone is emailed a message that contains the form submission in a GET query string, and a formerror would return to a 'blank' form that submits via POST -

subrequests in pyramid

2012-02-07 Thread Jonathan Vanasco
i'm trying to emulate how pylons used subrequests to handle htmlfill population on errors ( i'm using pyramid_handlers ) in my pylons emulation code, i have this: def form_reprint( request, form_print_method , **htmlfill_kwargs ): response= form_print_method() to call it, i would do:

Re: subrequests in pyramid

2012-02-07 Thread Jonathan Vanasco
thanks to both. i don't have a real subrequest going on - i'm passing in the name of the function that I'm calling... so its more like an emulation of a subrequest. I think i can get this working. ill post the result. -- You received this message because you are subscribed to the Google

SetCookie on redirect

2012-02-07 Thread Jonathan Vanasco
This was driving me crazy for a while. Finally i realized that Pyramid doesn't send any SetCookie commands when a redirect is called, because the HTTPFound is oblivious to the request. It's not entirely recommended to set cookies with a redirect as not all browsers accept them ( only Safari

Re: questions about integrating deform into production environment

2012-02-06 Thread Jonathan Vanasco
Sorry, i think I was unclear: If i do either of those methods, which i do now, requests are still going through the WSGI server. - I want to bypass that completely, by making the actual files of the referenced deform library directly accessible to the frontend server ( which would be nginx or

Re: questions about integrating deform into production environment

2012-02-06 Thread Jonathan Vanasco
yep, know all that. I meant i wanted to know if anyone has automated this for production , as part of a pyramid/deform integration package essentially the following: --- myapp/__init__.py from pyramid.events import ApplicationCreated from pyramid.events import subscriber

Re: questions about integrating deform into production environment

2012-02-06 Thread Jonathan Vanasco
the line above should actually be: static_subdir= event.app.registry.settings['deform.static_subdir'] -- 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: Pylons can be confusing to Pyramid

2012-02-06 Thread Jonathan Vanasco
small request for the next website: could the Projects and Documentation dropdowns please include links to the library packages example: Deform lists PylonsProject.com as the homepage on PyPi ( http://pypi.python.org/pypi/deform ) If you click that link , there's no mention of it - or there

Re: Pyramid 1.3 w/ URL dispatch but not SQLAlchemy?

2012-02-05 Thread Jonathan Vanasco
you could just make it with sqlalchemy, then delete the handful of lines . the integration is barely anything. -- 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: deform: is it possible to invalidate a form / field manually ?

2012-02-04 Thread Jonathan Vanasco
Well... I could probably do these validations within the validators, I just don't want to. I've got the gist ( https://gist.github.com/1734244 ) working pretty much perfectly to handle my needs right now. I dropped all the 'validators' handling, and am just limiting it to schemas -- because its

questions about integrating deform into production environment

2012-02-03 Thread Jonathan Vanasco
under all the integration docs, deform ends up being set as a static route under pyramid as /deform i'm wondering - has anybody put together a solution that can have one of these ( or similar ) happen during the startup/config process : 1- copy deform's /static files to app/static/deform 2-

is it safe to store data on handlers/views in self, or should it be self.request ?

2012-02-03 Thread Jonathan Vanasco
under pylons I had a lot of code that did misc prep work for certain methods in the request. because every view was an instance, it was pretty safe to just store stuff in the instance of the 'handler' class, and i didn't need to store it into the request object. i'm not sure how pyramid is set

Re: is it safe to store data on handlers/views in self, or should it be self.request ?

2012-02-03 Thread Jonathan Vanasco
great. that looks good. I need to read up more on views vs handlers. since i use render_to_response for most things, I should have an easy transition -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to

deform: is it possible to invalidate a form / field manually ?

2012-02-03 Thread Jonathan Vanasco
via FormEncode under Pylons, I was able to mark a valid field as invalid, and then reprint. i'm wondering if this is possible with deform. a pseudocode example of this in action would be something like this: def login(self): formLogin = deform.Form(FormLogin(_) posted =

Re: deform: is it possible to invalidate a form / field manually ?

2012-02-03 Thread Jonathan Vanasco
Thanks. I very much don't want to have that sort of pattern in programming though -- where the application logic becomes shifted into the form validation. I've run into too many issues with that making maintenance a nightmare, or causing 'expensive' calls to needlessly be made. I really want /

Re: deform: is it possible to invalidate a form / field manually ?

2012-02-03 Thread Jonathan Vanasco
hopefully someone will suggest a deform method... until then, i ported my modified version of the old pylons validation to pyramid... https://gist.github.com/1734244 - i didn't port the decorator, as i rarely use it [ and i couldn't figure out a good way to do it without mandating that a

Re: is it safe to store data on handlers/views in self, or should it be self.request ?

2012-02-03 Thread Jonathan Vanasco
could we rename pyramid_handlers to pyramid_controllers ? its the pylons appropriate name for them, and would probably solve a handful of issues. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email to

Re: Turbogears to Pyramid

2012-02-02 Thread Jonathan Vanasco
On Feb 1, 3:19 pm, Mike Orr sluggos...@gmail.com wrote: Actually, the closest thing to controllers is view classes. pyramid_handlers is one way to manage view classes, but increasingly people are doing it themselves with @view_config. Could you point me to something where someone does it

Re: URL rewriting in traversal appllication

2012-02-02 Thread Jonathan Vanasco
this is great. 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 pylons-discuss+unsubscr...@googlegroups.com. For more

Re: Turbogears to Pyramid

2012-02-02 Thread Jonathan Vanasco
mike- thanks. clears it up. i'm still using a mixture of @action and , increasingly, render_to_response. -- 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

how/where are mako templates cached in pyramid

2012-02-02 Thread Jonathan Vanasco
I just noticed this.. under pylons, mako templates are cached into app/data/templates/$name $.mako.py under pyramid, i don't see where they're cached - if at all. anyone have a clue ? -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post

Re: Storing settings on module level -- bad idea?

2012-01-31 Thread Jonathan Vanasco
I come from Pylons, where we had the g globals object. I miss it dearly. The Pyramid/Repoze group seems very much into the idea of passing a request around all the time. I don't like that, mostly from the 'mass appeal route' , in that its something that just about every other framework has, and

Re: Storing settings on module level -- bad idea?

2012-01-31 Thread Jonathan Vanasco
my .02¢ is this: App Developers like features like 'Globals'. It's something that is familiar-from, and present-in many other frameworks. Granted, pyramid is a low-level framework - and one that a more 'webmonkey' friendly framework might be built upon itself. But those frameworks are

Re: any advantages of using fast cgi over reverce proxy with nginx?

2012-01-30 Thread Jonathan Vanasco
Raoul - You've got nginx configured to serve static files directly, right? If not, that'll really improve your system. On Jan 30, 12:48 pm, Raoul Snyman raoul.sny...@gmail.com wrote: On 30 January 2012 19:20, cd34 mcd...@gmail.com wrote: You could use uwsgi (http://projects.unbit.it/uwsgi/)

Re: Redirect failure in page templates

2012-01-30 Thread Jonathan Vanasco
could you share the code that raised the exception , or an approximation of it ? -- 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

Re: any advantages of using fast cgi over reverce proxy with nginx?

2012-01-30 Thread Jonathan Vanasco
ah. well, I'd highly recommend doing that if you need to speed up your system. it cuts down on CPU and memory usage drastically. On Jan 30, 2:20 pm, Raoul Snyman raoul.sny...@gmail.com wrote: On 30 January 2012 20:25, Jonathan Vanasco jonat...@findmeon.com wrote: You've got nginx configured

Question about Multiple Database connections reflection with SqlAlchemy ( using sqlahelper )

2012-01-26 Thread Jonathan Vanasco
I've set up my application with multiple database connections to postgresql, which then reflects the table structure into my classes under /models. i am using sqlahelper. myapp_reader can read to all tables myapp_writer can read and write to all tables what I 'expected' is as follows: - calls

Re: Question about Multiple Database connections reflection with SqlAlchemy ( using sqlahelper )

2012-01-26 Thread Jonathan Vanasco
thanks. that post made me realize that I might just be able to port some old Pylons code to work with Pyramid. i've been using a mixture of what is essentially Mike Bayer's post + Mike Orr's sqlahelper for the past 4 years. i should just port it and package it for github -- You received this

Re: Question about Multiple Database connections reflection with SqlAlchemy ( using sqlahelper )

2012-01-26 Thread Jonathan Vanasco
ugly, but this seems to work for now... https://gist.github.com/1686834 -- 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

new package - custom facebook oauth flow , with pyramid support

2012-01-25 Thread Jonathan Vanasco
i just tossed this on github and pypi - facebook_utils https://github.com/jvanasco/facebook_utils http://pypi.python.org/pypi/facebook_utils it wraps the current facebook user flows. the official python sdk from facebook is deprecated and unsupported. the main class is FacebookHub an

what is the pyramid version of pylons globals ?

2012-01-24 Thread Jonathan Vanasco
on setup, I need to stash some information from the environment.ini script , which will be used on every request ( the facebook app ids for dev production ). the only way i can see doing it right now, is to either: 1. Create a globals dict in app/__init__.py 2. in app/__init__.py:main , push

Re: Different static directories for development/production

2012-01-17 Thread Jonathan Vanasco
someone on this list, not too long ago , wanted to render their javascript/css with mako or jinja templates. so they'd be normal javascript / css files -- but in production they might have some different vars or images. an example in practice: on an earlier version of a website ( which I had

Re: Different static directories for development/production

2012-01-16 Thread Jonathan Vanasco
I've done stuff like this before - but under mod_perl, not python - I think the same trick would work though... 1. The javascript source files were held out of the website/ application root - just for security and safety. they're held in something called assets/javascript/-source 2. On

Re: if anyone has time for feedback, i wrote a quick pyramid plugin for google analytics - pyramid_gaq

2012-01-13 Thread Jonathan Vanasco
wrote: Maybe these aren't doing the same thing, but another approach is to write a WSGI middleware ala Tres Seaver's repoze.urchin: http://pypi.python.org/pypi/repoze.urchin Chris On Fri, Jan 13, 2012 at 12:06 AM, Jonathan Vanasco jonat...@findmeon.comwrote: it's on github

Re: if anyone has time for feedback, i wrote a quick pyramid plugin for google analytics - pyramid_gaq

2012-01-13 Thread Jonathan Vanasco
ok. i'll migrate the docs from the docstrings into the toplevel distro ;) -- 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

Re: ajax cookbook suggestion

2012-01-12 Thread Jonathan Vanasco
I'm PERSONALLY not a fan of traversal , or of having that super REST oriented stuff. For short projects, like an ad campaign or prototyping a demo, i think its fine. For long term stuff, ajax functionality and requirements change.. so I prefer to just support a versioned API and consolidate

if anyone has time for feedback, i wrote a quick pyramid plugin for google analytics - pyramid_gaq

2012-01-12 Thread Jonathan Vanasco
it's on github -- https://github.com/jvanasco/pyramid_gaq it's fairly simple: - import it into helpers - in your base handler's __init__ call : gaq_setup( request, 'account_id' ) - set custom vars, events, etc, with commands that mimic the gaq commands - ie: _setCustomVar - gaq _setCustomVar -

Re: ajax cookbook suggestion

2012-01-10 Thread Jonathan Vanasco
As a matter of preference, I like to treat ajax in my pylons/pyramid apps in a very structured and repeatable way... 1. everything hits /api-public/versionX or /api-internal 2. i use a standard response object / formatting 3. i wrap everything in a try/except 4. i commit/rollback the return

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

2012-01-06 Thread Jonathan Vanasco
I've preferred the relative and @base solutions before without much issue. i'm assuming you're talking about https://launchpad.net/sloecode/trunk I would really focus on keeping the css out of the templating system. your css/img/js files really should never touch a dynamic server in a production

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

2012-01-06 Thread Jonathan Vanasco
make sure to bench in terms of concurrency and try to send a long term cache control header. the problem i experienced years ago under similar setups (mod_perl and mod_python) was this: the render/etc times were really nothing or the items were served 'raw' by the app -- but all the js / css /

<    4   5   6   7   8   9   10   11   12   13   >