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 week

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 o

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 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&#

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: 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" s

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 so

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 doesn

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 Grou

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: ret

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 the

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 fr

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
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 var

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 unsubscrib

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 s

Re: need your help to overhaul docs

2012-02-04 Thread Jonathan Vanasco
kickstarter? -- 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 options, vi

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 pylons-disc

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 viewcla

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 / n

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 = sel

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 pyl

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 up

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- symli

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: 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

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 o

Re: Turbogears to Pyramid

2012-02-02 Thread Jonathan Vanasco
On Feb 1, 3:19 pm, Mike Orr 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 themselves"? Jus

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 likely

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 c

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 wrote: > On 30 January 2012 20:25, Jonathan Vanasco wrote: > > > You've got nginx configured to serve static

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 t

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 wrote: > On 30 January 2012 19:20, cd34 wrote: > > > You could use uwsgi (http://projects.unbit.it/uwsgi/) which I think is > > a lot better

Re: SQLAHelper 1.0 released, and a proposal

2012-01-27 Thread Jonathan Vanasco
re: Michael Bayer & Mike Orr thanks for the pointers. wish i had checked in on this thread before coding last night :[ I already updated some old pylons code (and sqlalchemy .4 version) to work under pyramid and take advantage of zope i tossed it online here : https://gist.github.com/1686834

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 pylon

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 me

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 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 ancillary

Re: what is the pyramid version of pylons globals ?

2012-01-24 Thread Jonathan Vanasco
Perfect. thanks! On Jan 24, 1:13 pm, Michael Merickel wrote: > request.registry.settings -- 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, se

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 inh

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 applic

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 pylo

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

2012-01-13 Thread Jonathan Vanasco
: > 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 > wrote: >

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-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 everyt

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 value

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 / im

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: Are there references yet for SQLalchemy reflection and using multiple engines under pyramid ?

2012-01-03 Thread Jonathan Vanasco
Thanks. This ended up helping quite a bit! I haven't gotten into multiple databases yet, but I think it should be supported trivially I refactored your code for re-use into this pastebin - https://gist.github.com/1556734 I tried to make it simpler, but there is a bit of a janky hack in there.

Re: SQLAHelper 1.0 released, and a proposal

2012-01-02 Thread Jonathan Vanasco
I wish I was online over the holidays to take part in this discussion. Here's my .02¢ : - I think SqlAlchemy is the best ORM out there, and it's honestly been the deciding factor for me going with Pylons and sticking with Pyramid. - I think Pyramid core really needs to have a concrete DB/ORM plug

Re: pyramid and social auth

2012-01-02 Thread Jonathan Vanasco
I ran into similar confusions as you a few weeks back. What I realized is that Velruse - and some other packages - kind of exist as standalone authentication micro-apps that wrap other auth libraries, and not as libraries to build that functionality into your own app as you would want. For some p

Re: Are there references yet for SQLalchemy reflection and using multiple engines under pyramid ?

2011-12-20 Thread Jonathan Vanasco
wrote: > On Sunday, December 18, 2011 2:07:40 PM UTC-8, Jonathan Vanasco wrote: > > > ... > > > 2. Have my models reflect the database.  With some custom routines, I > > largely just had to pass in a string for the tablename and a sometimes > > primary key . > > >

Re: Serving Dynamic/Template js files

2011-12-19 Thread Jonathan Vanasco
I *think* wyatt might be referencing a technique similar to how Facebook Connect works. - In your templates, you can just set a JS variable/object in JSON , and then have your external JS files reference it on load. - Between using that, and a lot of callbacks in your JS code, you can keep most o

Are there references yet for SQLalchemy reflection and using multiple engines under pyramid ?

2011-12-18 Thread Jonathan Vanasco
I'm now using pyramid for some projects. Under Pylons I would almost always do the following: 1. Use multiple Engines ( Write, Read, Config, Log ) which each had different permissions in PostgreSQL. 2. Have my models reflect the database. With some custom routines, I largely just had to pass in

Re: Model validation

2011-12-17 Thread Jonathan Vanasco
I've built dozens of sites over the past 14 or so years , with Ad Agencies, Large Brands, Tech Startups, Major Media companies. Doing this, I've learned that Frameworks are really really great for the run-of-the-mill project that has a quick deadline, doesn't do anything new & exciting, and has a

Re: how to add query parameters to the current url in view code?

2011-12-09 Thread Jonathan Vanasco
Exactly what do you want to do - and why ? You're talking about adding a new sort parameter to the "current url". If you meant that you want to change the URL, then you have two options: 1. return a pyramid.httpexceptions.HTTPFound . you'd want to do this before you touch the database or any oth

Odd error from WebOb if you set a cookie value to be an Int and not a String

2011-12-08 Thread Jonathan Vanasco
The following line works fine: self.request.response.set_cookie( 'fb-loggedin', value='1', max_age=None, path='/' ) However, this line creates an interesting error self.request.response.set_cookie( 'fb-loggedin', value=1, max_age=None, path='/' ) "IOError: [Errno 20] Not a

Re: how can i access config settings in my pyramid app handlers/templates ?

2011-12-06 Thread Jonathan Vanasco
thanks kindly! i probably glanced over that line a dozen times. On Dec 6, 1:32 pm, Chris McDonough wrote: > On Tue, 2011-12-06 at 10:28 -0800, Jonathan Vanasco wrote: > > in pylons , i only had to do : > > >    from pylons import config > > > and then all my (developme

how can i access config settings in my pyramid app handlers/templates ?

2011-12-06 Thread Jonathan Vanasco
in pylons , i only had to do : from pylons import config and then all my (development|production).ini info was available what is the equivalent under pyramid ? i can't seem to figure it out. -- You received this message because you are subscribed to the Google Groups "pylons-discuss" grou

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
On Dec 4, 8:11 pm, Mike Orr wrote: > By the way, I'm working on Akhet 2 which will not have an application > scaffold, but expanded docs instead. So the days of the 'akhet' > scaffold are numbered. Sigh. I do like the scaffold. It's mostly going to be replaced with pyramid_sqla though - right

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
so you sort of solved this. you at least pointed me in the right direction to experiment! works: @action(renderer='json') doesn't work: @view_config(renderer='json') On Dec 4, 8:11 pm, Mike Orr wrote: > I don't think so, but akhet does use pyramid_handlers, so it's attuned > to @a

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
dicts and lists don't work. i posted a list to the group, because its the simplest object. On Dec 4, 7:08 pm, John Anderson wrote: > You should  return a dictionary not a list. > > rval = {'values': [1,2,4]} > > On Sun, Dec 4, 2011 at 5:34 PM, Jonathan Vanasco wrot

enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
i'm using pyramid with akhet according to the docs, i should be able to do something like this: @view_config(renderer='json') def login_status(self): rval= [1,2,4] return rval That creates an error for me: ValueError: Could not convert view return value "[1, 2, 4]" in

Re: Strange paster serve behavior

2011-12-02 Thread Jonathan Vanasco
No idea. Is there any way to log/debug what is happening within vim? FYI: My normal workflow though is: Terminal window 1: $ paster serve --reload development.ini Terminal window 2-10 vim, postgres, etc + textwrangler windows On Dec 2, 10:47 am, Mark Erbaugh wrote: > I'm developing w

Re: pyramid.config - what is _ainfo ?

2011-11-30 Thread Jonathan Vanasco
@John Anderson You could do that, but then you're using the Pyramid auth/security framewor - and i want to stay away from it. i'm not a fan of its design, and it won't work easily/quickly with how I like to build apps. -- You received this message because you are subscribed to the Google Groups

Re: Production.ini

2011-11-30 Thread Jonathan Vanasco
On Nov 30, 12:24 pm, Michael Bayer wrote: > careful with "environment" variables though - regular shell variables can be > viewed in a ps listing (-E flag ). Correct. But most people won't be running apps on a shared machine these days. When people do, most hosts run virtualization or 'lockdo

Re: Production.ini

2011-11-30 Thread Jonathan Vanasco
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 file's revision control info viewable as plaintext 3. not trusting the source

Re: pyramid.config - what is _ainfo ?

2011-11-30 Thread Jonathan Vanasco
On Nov 29, 9:23 pm, Michael Merickel wrote: > Regardless, I hope this is way too much information about Pyramid internals > and I'm curious what you're planning on doing that you'd need to trace the > undocumented apis. First, thanks a TON! This is *way* too much info indeed! I just wanted to

pyramid.config - what is _ainfo ?

2011-11-29 Thread Jonathan Vanasco
it's in the Configurator an the action_method decorator just wondering what it is, i'm knee deep trying to understand the architecture -- 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@googleg

Re: How can I map a dash/hyphen in a route 'action' under pyramid ?

2011-11-29 Thread Jonathan Vanasco
Thanks Michael and Chris! Michael's solution worked instantly. I was having trouble getting Chris's to work... then realized that I was running pyramid_handlers 0.1 , not 0.4. instant gratification after upgrade! -- You received this message because you are subscribed to the Google Groups "py

How can I map a dash/hyphen in a route 'action' under pyramid ?

2011-11-22 Thread Jonathan Vanasco
Pylons had a nice little convenience method under the hood... If i had the equivalent of: config.add_handler("account", "/account/{action}", "myapp.handlers.account:AccountHandler",) a request to- account/sign-up would map to- class AccountHandler: def sign_up():

Re: Mobile Browser Detection

2011-11-22 Thread Jonathan Vanasco
thanks all for the insight. a couple of quick responses : 1. i like to put 'device' and feature detection client-side as much as possible, but i've encountered situations where you need to implement a server-side solution: a) the webpage is too large , and you want to keep all JS running until

Mobile Browser Detection

2011-11-22 Thread Jonathan Vanasco
I've been trying to figure out the best way to handle mobile browser detection. I was hoping to find something in the Pyramid stack, but didn't. After searching online, I found a handful of various projects - with the bulk of them aimed at Django. I found a simple version based on a regex, and p

Re: Akhet status (Pyramid newbies and Carlos d.l.G., read me)

2011-03-14 Thread Jonathan Vanasco
when is a good time for us to connect on aim/irc/etc and plan some integration stuff out ? -- 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, se

Re: Porting a Pylons app to Akhet

2011-03-12 Thread Jonathan Vanasco
I think pyramid_simpleform is the easiest. I forked it and added a method to handle form reprints. I think its in that sqla fork I shared with you too. if you stick to the following paradigm, it works well: def form_dispatch: if request.submit: return self._form_submit return se

Re: question about middleware

2011-03-04 Thread Jonathan Vanasco
thanks. the accepted ips don't need to be db based. the notion is that you can trivially ensure that a request is through your gateway and doesn't have spoofed headers if the application recognizes both a the ip of the server and a secret that only those ips would know. for example, you would co

question about middleware

2011-03-04 Thread Jonathan Vanasco
i'm trying to port an old perl project ( which was essentially middleware for the mod_perl environment ) to Pyramid/WSGI The basic premise is that it: - migrates the x-fowraded-for header into remote-addr - but only from accepted servers by ip - but only from accepted servers with a lan secret th

Re: pylons-discuss and pylons-devel

2011-03-03 Thread Jonathan Vanasco
i've noticed a lot of -discuss items being spoken about in -devel lately... i had often thought that -discuss was for people /using/ pyramid, and -devel was for people /building/ it. if that is still the case, can i suggest the -devel list make a firm policy of having people repost here? -- You

Re: Pyramid/Pylons Project status update...

2011-02-27 Thread Jonathan Vanasco
Great news to see traction! I've been busy porting over a microframework we used under Pylons for many projects to Pyramid and shared with some trusted friends. The application design is changing quite a bit due to pyramid, so its a complete rewrite. I'm taking this as an opportunity to just sta

are there pyramid analogues to AttribSafeContextObj ?

2011-02-27 Thread Jonathan Vanasco
just noticed that ContextObj and AttribSafeContextObj are not in pyramid. are there versions in pyramid, or are they gone ? -- 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.

are there pyramid analogues to AttribSafeContextObj ?

2011-02-27 Thread Jonathan Vanasco
just noticed that ContextObj and AttribSafeContextObj are not in pyramid. are there versions in pyramid, or are they gone ? -- 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: Attach SQLAlchemy Session to settings object instead of creating module global?

2011-02-24 Thread Jonathan Vanasco
have you looked at the pyramid_sqla stuff ? i think mike orr may have done some of this. in my pylons apps, ive never needed sessions to persist between requests.. so i looked more at global settings and request based stashes. On Feb 24, 9:51 pm, Wyatt Baldwin wrote: > In Pylons, there's a reco

Re: How to serve content of the database field as a file for download.

2011-02-24 Thread Jonathan Vanasco
you should ask on the cherrypy list. that is another webserver, different than pylons. On Feb 24, 3:48 am, Sandeep Kulkarni wrote: > Hi, > > Following is my back end code in python. > >     def download_key(self): >         import cherrypy >         cherrypy.response.headers['Content-Type'] = >

Re: is it possible to do a redirect in a pyramid handler's __init__ ?

2011-02-22 Thread Jonathan Vanasco
gt; Do this, then use "raise > pyramid.httpexceptions.HTTPFound(location='http://...')" wherever you > need to do a redirect. > > > > On Tue, 2011-02-22 at 09:06 -0800, Jonathan Vanasco wrote: > > i'm trying to port some custom pylons authentication , whic

is it possible to do a redirect in a pyramid handler's __init__ ?

2011-02-22 Thread Jonathan Vanasco
i'm trying to port some custom pylons authentication , which had redirects in __init__ and __before__ -- 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 thi

Re: a few more pyramid questions

2011-02-21 Thread Jonathan Vanasco
after fighting for a while, i got the functionality i needed , and integrated it with form processing i forked pyramid_simpleform on bitbucket and refactored `_form_reprint` into `handler_reprint`. it was pain to figure out how to munge the response object correctly... and i should probably chang

Re: a few more pyramid questions

2011-02-21 Thread Jonathan Vanasco
To be clear: This works: @action(renderer='/test_a.mako') def test_a1(self): return {'project':'myapp'} @action(renderer='/test_b.mako') def test_b1(self): return {'project':'myapp'} def test_c1(self): return render_to_response('/test_b.mako', self.te

Re: a few more pyramid questions

2011-02-20 Thread Jonathan Vanasco
sorry, let me rephrase - is it possible to dispatch to another function and have it handle the render + define the template ? -- 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

a few more pyramid questions

2011-02-20 Thread Jonathan Vanasco
i'm trying to figure out some paradigms in pyramid using the pyramid_sqla template... if i have: @action(renderer='/account/test_a.mako') def test_a(self): return {'project':'myapp'} @action(renderer='/account/test_b.mako') def test_b(self): return {'project':'my

Re: Form handling in Pyramid

2011-02-20 Thread Jonathan Vanasco
personally, think it would be best to decouple the moving parts as much as possible to me, there is : html form creation - great if this is baked-in, but it shouldn't be required form validation - i think formencode is fine, but i often use it as a first-pass and then handle things in my co

Re: some thoughts on pyramid

2011-02-19 Thread Jonathan Vanasco
I've forked Mike's pyramid_sqla , and have been extending the templates to be more familiar to pylons users. Namely: 1- making the app structure seem more like a more mature pylons 1.0 app 2- added some reference functions around form submissions , beaker session usage , etc 3- integrated some rou

Re: some thoughts on pyramid

2011-02-18 Thread Jonathan Vanasco
On Feb 18, 12:21 pm, Ben Bangert wrote: > Getting there got the Pylons framework on there, and most everything is > on GitHub that the Pylons Project encompassas. Which projects were you > referring to that aren't? pyramid_sqla isn't. If Mike Orr wants help learning git/github , i'd be

Re: some thoughts on pyramid

2011-02-18 Thread Jonathan Vanasco
1. I think it would be better if everything related to Pyramid/Pylons were on a single system ( ie: GitHub or BitBucket ). 2. The Pyramid stuff should have better linkage on PylonsHQ.com ; its a text-link buried in paragraphs. 3. I'm looking at the pyramid_sqla template. question.. i see stuff li

Re: some thoughts on pyramid

2011-02-15 Thread Jonathan Vanasco
On Feb 14, 10:08 pm, Mike Orr wrote: > Have you seen the pyramid_sqla package, which includes an application > template? It addresses these three. Nope. Took a lot of combing to find. It was kind of hidden under some text on the Pyramid intro. Would be great to see that in another "tool tip"

some thoughts on pyramid

2011-02-14 Thread Jonathan Vanasco
I spent some time today with Pyramid. It was a bit of a rollercoaster -- at times I was very excited, at others very stressed. i figured i'd share my thoughts here for the maintainers. 1. on setting up an app, there were no instructions on how to setup for a postgres 'url' in sqlalchemy ; in fac

Re: Pyramid for Pylons users guide

2011-01-20 Thread Jonathan Vanasco
i'm looking at porting some stuff over, and after reading the docs have a few concerns: - under pylons i have multiple db connections : read, write, log, admin-write, etc. each has different db permissions to ensure security and tie in with clustering. all the Pyramid examples I've seen revolve

Re: Pylons for Facebook apps

2010-08-26 Thread Jonathan Vanasco
I've done a lot of cross-language systems. They're really quite easy. The main issue with them is session data, but everyone can read YAML and JSON. while they're not as fast as natively pickled/packed data, even the slowest systems around can process them with ease. -- You received this message

Re: Pylons for Facebook apps

2010-08-25 Thread Jonathan Vanasco
i tried it a while back, and then gave up. i don't think its worth it, because facebook has changed the way the apps work so many damn times i think you'd be better off just using one of the many full-featured, mature, has-tons-of-people-maintaining-it php libraries that are out there , and let t

Re: How to strip HTML tags?

2010-08-25 Thread Jonathan Vanasco
beautiful soup lets you do it too, and fixes the document while its at 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-disc...@googlegroups.com. To unsubscribe from this group, send email to p

has anyone seen pinax before ?

2010-08-25 Thread Jonathan Vanasco
http://pinaxproject.com/ i've been working on something similar that is pylons based for a while; but they're already up and running -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to pylons-disc...@googlegro

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