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

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

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

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

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

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

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 chr...@plope.com 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 (development|production).ini

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]

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 son...@gmail.com 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 jonat

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 sluggos...@gmail.com wrote: I don't think so, but akhet does use pyramid_handlers, so

Re: enabling json under akhet ?

2011-12-04 Thread Jonathan Vanasco
On Dec 4, 8:11 pm, Mike Orr sluggos...@gmail.com 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

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 m...@microenh.com wrote:

Re: pyramid.config - what is _ainfo ?

2011-11-30 Thread Jonathan Vanasco
On Nov 29, 9:23 pm, Michael Merickel mmeri...@gmail.com 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!

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

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

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

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

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

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

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

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

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

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

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 sandeep.kulka...@bsil.com wrote: Hi, Following is my back end code in python.     def download_key(self):         import cherrypy        

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 wyatt.lee.bald...@gmail.com wrote:

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

2011-02-22 Thread Jonathan Vanasco
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 , which had redirects in __init__ and __before__ -- You received this message because

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',

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

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

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

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.

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

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

Re: some thoughts on pyramid

2011-02-18 Thread Jonathan Vanasco
On Feb 18, 12:21 pm, Ben Bangert b...@groovie.org 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

Re: some thoughts on pyramid

2011-02-15 Thread Jonathan Vanasco
On Feb 14, 10:08 pm, Mike Orr sluggos...@gmail.com 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

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

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

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

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

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

Re: Hiring Pylons Devs in NYC

2010-08-13 Thread Jonathan Vanasco
On Aug 12, 9:33 pm, Mike Orr sluggos...@gmail.com wrote: Hooray. I'm not in NYC but I've heard most of the jobs there are Java, so I'm glad more Python employers are appearing. Maybe you can hire me in a few years if I ever move there. :) Let me know if you do! But I'll probably be living

Hiring Pylons Devs in NYC

2010-08-12 Thread Jonathan Vanasco
Hi all- One of the startups that I'm working with will be starting a round of hiring in the next 2-6 weeks. We're in NYC. I'm effectively the director of product engineering... or something like that. The CTO is focused on RD, so I'm dually the product manager and building out the development

Re: Hiring Pylons Devs in NYC

2010-08-12 Thread Jonathan Vanasco
On Aug 12, 6:54 pm, Wojtek Augustynski waugustyn...@gmail.com wrote: Nice to see. Wish there were more Pylons jobs in the SF Bay Area! :) ?!? There are TONS. a lot of the 'hot' and well funded startups are hiring pylons people. -- You received this message because you are subscribed to the

OT -- odd mac issue - pylons stopped serving

2010-06-16 Thread Jonathan Vanasco
this just happened today, its driving me crazy all of my (local) pylons apps won't respond on my mac. the browser pause for a few seconds, and then i see: RTSP/1.0 404 Not Found Content-Length: 0 it's happening with all browsers. anyone have an idea what setting I messed up ? -- You

Re: OT -- odd mac issue - pylons stopped serving

2010-06-16 Thread Jonathan Vanasco
On Jun 16, 2:23 pm, cd34 mcd...@gmail.com wrote: Are you running the Darwin/Quicktime Streaming Server on your machine? figured it out! VLC had crashed earlier in the week, and somehow grabbed a slew of ports. thanks for pointing me in the right direction. i couldn't figure out what / why

Re: FormEncode inadequate?

2010-05-14 Thread Jonathan Vanasco
I use FormEncode very happily... along with a custom solution. 1. For multiple-step logic, I use multiple FormEncode forms. 2. For advanced formatting, my stuff looks like this: def form(self): if request.params.get('m') == 'submit': return self._form__submit() return

Re: Developing with paste http only

2010-05-06 Thread Jonathan Vanasco
just make a function in helpers: def my_url( u ): u2= url(u) if config['site_url_scheme'] == 'https': something else: somthing and call h.my_url() wherever you need it you could even redefine url() and then access the original, but stuff like that can be a PITA to debug

Re: application deployment question about nginx and pylons

2010-05-06 Thread Jonathan Vanasco
I'm of this school of thought: if you're doing anything with moderate to high traffic, you should be running NGINX on port 80 , with a proxypass to something else. What you proxypass to, however, is up to you. 1- paster 2- wsgi 3- apache the important thing is to get Apache off of port 80 , its

Re: Pylons hosting on a VPS (memory usage)

2010-04-21 Thread Jonathan Vanasco
i'm running pylons apps on a few VPS my issues have been this: - the database takes up a lot of ram - the search engine takes up a lot of ram pylons app performance has been better as more ram is tossed in. if you're running a DB like postgres or mysql on the same vps, i would probably use

is there a way to access the db connection handle of a sqlalchemy object , from the object ?

2010-04-16 Thread Jonathan Vanasco
i never had to do this before. some sample code is below; basically in a function i need to 'expire' some looped items , so i pull fresh from the db. my problem is that i don't know how to access the db from within the model ; i could pass-it-in explicitly from the controller... but i'd really

Re: best practices when writing controllers

2010-04-06 Thread Jonathan Vanasco
On Apr 4, 4:28 pm, cd34 mcd...@gmail.com wrote: While the controller is cleaner, does that really make it more readable?  From a maintainability standpoint, would someone new to the code be able to see what that action was doing reasonably quickly? If i were going for code readability, I

Re: best practices when writing controllers

2010-04-04 Thread Jonathan Vanasco
On Apr 3, 2:51 pm, cd34 mcd...@gmail.com wrote:         (task_id,status) = task().bigtask().add(get_client_id(), \                            request.params['device_id'], \                            request.params['username'], \                            request.params['ip'], \            

Re: Include return value of other controllers in template

2010-04-01 Thread Jonathan Vanasco
i handle this two different ways: 1- I'll use a helper function to handle this /lib/helpers/comments def list_comments( object , offset=0 , limit=10 ): # stuff here to grab the comments # return fragment or populate c? who knows 2- I'll use a shared inheritance class def

Re: reference to app

2010-03-18 Thread Jonathan Vanasco
slightly off topic... my app/__init__.py file always has this bit: import sys appdir= sys.path[0] appexternals= %s/##APPNAME##/lib/externals % appdir sys.path.append(appexternals) import OpenSocialNetwork OpenSocialNetwork.appname= '##APPNAME##/' osn is a microframework that's in

any good references / best practices for Test Driven Design and Integrated Testing with Pylons ?

2010-03-18 Thread Jonathan Vanasco
I really do love the fact that Pylons offers the unit tests ; however as others have mentioned - they can be really difficult to use when session based data is concerned ( or when forms require access to Globals ,etc etc ) I pretty much stopped using them a while back, and just started doing

Re: Versioned routes

2010-03-16 Thread Jonathan Vanasco
routes allows for functions to be used - you could match on the / app, and then use a function to determine the function. there are a few examples in this mailing list archives, the docs on routes don't really make this feature clear ( or even how to use it ) -- You received this message

Re: which is the best ORM recommended?

2010-03-15 Thread Jonathan Vanasco
for what its worth... I find ORM useful for three things: - inserts of new records - updates of single records - displaying data in templates i find ORM a hassle on larger items. i'd much rather write SQL myself , that i know is optimized and i have control over. A great middle ground which

Re: Link to files stored in data directory

2010-03-07 Thread Jonathan Vanasco
i store the files into a top-level directory called user_uploads ( ie. on the same level as data and public ) i do this, only because i find it easier to handle backups / redundancy when the images are 'public', i have a symlink from public/_img/NAME into that directory. just to note, i never

Re: redirect and template_context

2010-03-06 Thread Jonathan Vanasco
just to add... the return in return redirect is unnecessary. a simple redirect will suffice. redirect raises an exception, which Pylons itself catches. as wyatt stated, the script is terminated, and the user is redirected to a new page with the c context tossed out. i usually toss any

looping sqlalchemy attributes

2010-03-05 Thread Jonathan Vanasco
my code is still running on sqlalchemy .48, so if this has been addressed in future versions - let me know! lets say i have a one-to-many sqlalchemy relation, and loop an attribute called items: def cleanup( cart ): for item in cart.items: if item.qty == 0 :

Re: Validating a select box

2010-03-02 Thread Jonathan Vanasco
Mike danced around a good point above which he didn't explictly mention - for most formencode validators the results will be Strings -- both in the validator and form_result. So they may mess up your comparisons or validations. -- You received this message because you are subscribed to the

Re: Validating a select box

2010-03-02 Thread Jonathan Vanasco
sorry, i'm sick and really loopy... let me rephrase ( and this may have changed since last i tested a while bac ) everything that comes through request.params / submitted to your pylons app is a string there are some neat validators that will handle conversions for you, so everything is

unexpected behavior of request.params after validate ; is this intentional of webob (not @validate)?

2010-02-28 Thread Jonathan Vanasco
i spent the past 3 hours going through my own validate code, and the original pylons that i forked off of, trying to figure out why params is always empty on a form error. i finally tracked down the issue. @validate has this line, so that the form can be re-run as a GET with htmlfill args:

Re: Validating whether a field value is equal to another

2010-02-28 Thread Jonathan Vanasco
personally, i keep anything that could hit the database away from formencode i use formencode to validate presence and formatting / regex, and keep the db logic within a try/except block. if i have an error, i'll raise a SubmissionError - or similar - and then return the form. i do this for a

Re: @validate revisited, JSON support, content negotiation

2010-02-27 Thread Jonathan Vanasco
ah, interesting -- so the validation becomes a function of the controller. i'd like to make a suggestion to your then. i have an arg to validate called gatekeeper , which is enabled as True by default ( along with post_only ) In conjunction with one another, gatekeeper just makes sure that if

Re: Pylons and images from database

2010-02-25 Thread Jonathan Vanasco
if you store things on the filesystem, you'll need to use a hashing algorithm to bucket it effectively -- filesystems don't like too many files in a directory. you don't need to rename the file to a hash -- you could just store that in the db -- but I'd advise renaming the file to a hash,

Re: does session.save() not work if you raise an exception? is there a way to override ?

2010-02-25 Thread Jonathan Vanasco
just to clarify, this is beaker sesssions -- not SA -- 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

Re: @validate revisited, JSON support, content negotiation

2010-02-23 Thread Jonathan Vanasco
does this new approach allow for form errors to be re-triggered in the controller like my stab ( http://groups.google.com/group/pylons-discuss/browse_thread/thread/4269ca745e31793 ) ? because that's the only thing i care about. example: from OpenSocialNetwork.lib.decorators import osn_validate

Re: Writing a web app as a series of plugins

2010-02-17 Thread Jonathan Vanasco
I tried to do this before, and gave up. It became WAY too confusing and difficult to manage as WSGI components. What I ended up doing is creating a single WSGI component to 'plugin' and bootstrap some special variables into 'c'. I then created a series of Libraries that offer functions and

Re: My experience upgrading to Pylons 1.0b

2010-02-12 Thread Jonathan Vanasco
On Feb 12, 3:33 pm, Wyatt Baldwin wyatt.lee.bald...@gmail.com wrote: The only other thing that threw me off (just a little) was `app_globals`. It was clear that `pylons.c` and `pylons.g` are gone, but it wasn't clear that `g` is no longer available in *templates*, partly because `c` still is

Re: handling secure information

2010-02-10 Thread Jonathan Vanasco
Showing the last 4 digits and Card type is common , and the industry standard in business in the US. It's what every large online retailer /biller does, its what credit receipts do -- its generally fine for users and companies alike. Usually its shown as VISA : 1234 What you

Re: writing to g/app_globals -- is it safe for caching info after startup ?

2010-02-09 Thread Jonathan Vanasco
On Feb 9, 10:19 am, Damian damiandimm...@gmail.com wrote: app globals is not thread safe - if you write to it concurrently you will be in trouble.  I keep a lot of stuff in app globals that is set on startup and never changed. Thanks for that :( I'm wondering... maybe there is a way to handle

Re: writing to g/app_globals -- is it safe for caching info after startup ?

2010-02-09 Thread Jonathan Vanasco
On Feb 9, 6:15 am, Pēteris Caune cuu...@gmail.com wrote: One thing to keep in mind is that if you'll deploy your webapp with Apache and mod_wsgi, Having spent much time with Apache's internals and mod_perl, I never use Apache unless I have to. Which means I only use it for running mod_perl

Re: writing to g/app_globals -- is it safe for caching info after startup ?

2010-02-09 Thread Jonathan Vanasco
On Feb 9, 2:57 pm, Mike Orr sluggos...@gmail.com wrote: The reason the SQLAlchemy Session was moved from app_globals to the model was not because it's unsafe, but so that the model can be used standalone without depending on the rest of the application or Pylons. When did that happen? If

Re: writing to g/app_globals -- is it safe for caching info after startup ?

2010-02-09 Thread Jonathan Vanasco
On Feb 9, 5:04 pm, Mike Orr sluggos...@gmail.com wrote: It was earlier, in 0.9.6 or 0.9.7 that it happened. Yay! -- 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

Re: Caching in pylons?

2010-02-08 Thread Jonathan Vanasco
On Feb 8, 9:16 am, gazza burslem2...@yahoo.com wrote:  I can just use the autocomplete=off for selected fields. i didn't know browsers respected that. neat! with the prefix concept above, every request would have a different prefix... so autocomplete/autofill wouldn't know how to use browser

writing to g/app_globals -- is it safe for caching info after startup ?

2010-02-08 Thread Jonathan Vanasco
i have some data that I cache on startup -- mostly config info and misc database intensive stuff. i need to reload every so often. is it safe to reload it into g ? or should i cache this in memcached or similar ? -- You received this message because you are subscribed to the Google Groups

Re: Caching in pylons?

2010-02-07 Thread Jonathan Vanasco
beaker has an invalidate call which will expire the cached it. if you're trying to turn caching off for the pages, caching is explicit -- so just don't call it. -- You received this message because you are subscribed to the Google Groups pylons-discuss group. To post to this group, send email

Re: Caching in pylons?

2010-02-07 Thread Jonathan Vanasco
On Feb 7, 8:32 pm, Mike Orr sluggos...@gmail.com wrote: You may be observing a different phenomenon, where the browser saves the values input into forms, and offers to re-enter them later if the form looks similar enough. This is not related to the cache settings. It's related to the

Re: Do your models handle all the data logic?

2010-02-04 Thread Jonathan Vanasco
On Feb 3, 12:28 pm, Haron Media i...@haronmedia.com wrote: But if you have the constraints, you're doing the checks twice. First from your application, and then the db engine does it anyways since there are constraints. Perhaps you don't have a performance hit, but I can assure you, if you

Re: Do your models handle all the data logic?

2010-02-03 Thread Jonathan Vanasco
I use PostgreSQL exclusively too, and rely on tons of constraints within the db - from unique indexes built through functions, to actual functions themselves. I still, pretty much, always query the db to check for a duplicate value or possible constraint violation. 1- It's easier than parsing

Re: Caching all but 1 variable.

2010-02-02 Thread Jonathan Vanasco
On Feb 2, 3:07 pm, Andy (Zenom) stress...@gmail.com wrote: Someone in IRC said write a wrapper, but having a hard time wrapping my head around this, since the data I need to cache is all in the controller and there could be multiple queries etc. If I wrap the render method somehow, then the

Re: two routes / dispatch questions

2010-01-30 Thread Jonathan Vanasco
On Jan 30, 2:06 am, Mike Orr sluggos...@gmail.com wrote: I consider such slash manipulation to be highly unorthodox and undesirable, but that's how you can do it if you want to. Thanks Mike! I find the slash manipulation to be standard. The default behavior for static webservers has been:

two routes / dispatch questions

2010-01-29 Thread Jonathan Vanasco
using Routes 1.10 and 1.11 ... 1) how can i match to a single controller's /admin - def index /admin/ - def index /admin/$action$ - def $action must i do this explicitly in two calls ? because /admin/{action} requires the / 2) is it possible to use the {action} as a

Re: Lazy Registration

2010-01-25 Thread Jonathan Vanasco
On Jan 25, 4:36 am, Wichert Akkerman wich...@wiggy.net wrote: Beaker sessions. either beaker sessions, or just use a beaker session id as the shopping cart / user id you could do a dbtable that has this: table: cart id bigserial primary key not null, session_id char(32) unique ,

Re: How extensible is AuthKit?

2010-01-05 Thread Jonathan Vanasco
i don't like AuthKit ( no offense James ! - it's just never served my needs ) and have had to integrate with systems like you describe. so the tips i can give are this: - create your validation and cookie-set/expire functions in something like app/lib/helpers/auth.py - put the logic you need in

Re: Roadmap / 0.10 / 1.0 (resource routes)

2009-12-21 Thread Jonathan Vanasco
On Dec 21, 3:54 pm, Mike Orr sluggos...@gmail.com wrote: def resource2(self, name, path, new=True, edit=True, delete=True):     GET /myresource                : view index     GET /myresource/new         : new form     POST /myresource/new       : new action     GET /myresource/1        

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-08 Thread Jonathan Vanasco
First, thanks all. Subrequests in Apache are weird. IIRC, they appear to be a new request - but something in mod_perl's request context object will note that it is a subrequest, and provide a facility to access the 'top level' context object information. this is in line with what Shailesh

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-07 Thread Jonathan Vanasco
mike- on the subject... does Pylons have a subrequest facility ? Some platforms , like mod_perl , offer it: http://perl.apache.org/docs/2.0/api/Apache2/SubRequest.html internal_redirect Redirect the current request to some other uri internally $r-internal_redirect($new_uri); * obj: $r

Re: clearing out old cache/session files from beaker

2009-12-06 Thread Jonathan Vanasco
to be honest... a while back, i set my sessions to be flat-file based, just because I didn't want to deal with the stuff you're going through ;) i had sessions in postgres at one time, but i don't think they were beaker based. it was a tie-in to some mod_perl legacy apps. for them i did this

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-06 Thread Jonathan Vanasco
On Dec 6, 1:40 pm, jnowl john_now...@carleton.ca wrote: Ha! O.k. I think it's pretty clear who is confused. :) ha! just to reiterate on mike's point above, please don't take any of my curt responses as being insensitive, mean or condescending. i just meant for you to read up on that stuff

Re: Calling a controllers method from another method? Is there a 'safe' way without redirecting?

2009-12-05 Thread Jonathan Vanasco
On Dec 5, 3:37 pm, Mike Orr sluggos...@gmail.com wrote: Ouch, that sounds like I'm better than you but I'm not going to tell you why.  In other words, it may or may not be true, depending on whatever he might be basing it on. That's supposed to sound like Every website on the internet follows

Re: clearing out old cache/session files from beaker

2009-12-04 Thread Jonathan Vanasco
On Dec 4, 8:52 am, Damian damiandimm...@gmail.com wrote: Ah - found the following on removing expired sessions and it basically suggests doing what I wanted: http://beaker.groovie.org/sessions.html No it doesn't. It states When using the file-based sessions then suggests another approach

<    5   6   7   8   9   10   11   12   13   >