Re: Problems with pylons.decorators.validate

2009-01-05 Thread Ben Bangert
On Jan 4, 2009, at 2:45 PM, Tycon wrote: PylonsHQ ticket system is down (does it run on pylons?) Not that one. I was hacking Trac code to allow Trac to take auth data from a Pylons app (the Pylons controller dispatches to Trac via WSGI) for the new site, and accidentally left the tweaks in

Re: Ten reasons why couchdb is better than (off topic)

2009-01-05 Thread Ben Bangert
On Jan 3, 2009, at 1:09 PM, mobil wrote: Ten reasons why couchdb is better than (off topic) http://pylab.blogspot.com/2009/01/ten-reasons-why-couchdb-is-better-than.html Guys I wrote up a small list of reasons why i think couchdb is way bettter than mysql. Do let me know what you think I thin

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Ben Bangert
On Jan 4, 2009, at 2:29 PM, Tycon wrote: from the "url_for" doc string : If no route by that name is found, the string is assumed to be a raw URL. Should the raw URL begin with ``/`` then appropriate SCRIPT_NAME data will be added if present, otherwise the string will be used as the ur

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Ben Bangert
On Jan 4, 2009, at 9:06 PM, Tycon wrote: Another issue with url_for is the handling of query string parameters using keyword arguments. Currently any extra keyword arguments will be added to the generated URL as query string, for example: url_for('/page', arg='val') ==> /page?arg=val The p

Re: pylons.decorators.secure.https throws away the query string ?

2009-01-05 Thread Ben Bangert
On Jan 3, 2009, at 12:34 AM, Tycon wrote: but the PrefixMiddleWare also doesn't seem to be setting the WSGI environment url_scheme (nor request.scheme). The PrefixMiddleware code never looks up HTTP_X_FORWARDED_PROTO and doesn't set the url scheme in the wsgi environment. So that needs to be fi

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mark Ramm
> Another issue with url_for is the handling of query string parameters > using keyword arguments. Currently any extra keyword arguments will be > added to the generated URL as query string, for example: > > url_for('/page', arg='val') ==> /page?arg=val > > The problem is that you can't use ke

a better way to run multiple pylons apps?

2009-01-05 Thread eleith
i've got a domain: example.com i want to run ten different websites (sub1.example.com, sub2.example.com sub10.example.com) a different pylons app will be running each of the 10 websites i'm proxying scgi from lighttpd (10 entries, each website running on port 5001, 5002 ... 5010) i have a

Re: pylons.decorators.secure.https throws away the query string ?

2009-01-05 Thread Tycon
PasteDeploy 1.3.2 Paste 1.7.2 According to (non)-easy-install these are the "best" match version, and it's "already the active version in easy-install.pth", so hopefully that means I have the latest version in "easy- install" (=cryptic) speak. On Jan 5, 10:04 am, Ben Bangert wrote: > On Jan 3,

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mark Ramm
> But what if I don't want to SCRIPT_NAME to be prefixed to the URL > because it's a link for a different application ? For example if > pylons app has SCRIPT_NAME of "/pylons" but I want to create a URL for > "/blog/newposts" which is served an a different blog application (so > it should not b

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Tycon
I think we need to have three new arguments to url_for: params (dict) - used to create the query string (while deprecating the keyword args method, just like the comment about turbogears mentioned). raw (boolean) - if true then the url is presumed to raw so we don't try to do a routing map match

setting the filename for download

2009-01-05 Thread mk
Hello everyone, I'm a beginner with Pylons and am trying to set the filename of a file to download in an action (that is, controller method): def environ3(self): msg = list(request.environ.items()) msg = [ str(el[0]) + " " + str(el[1]) for el in msg ] msg.sort()

setting the filename for download

2009-01-05 Thread mk
Hello everyone, I'm a beginner with Pylons and am trying to set the filename of a file to download in an action (that is, controller method): def environ3(self): msg = list(request.environ.items()) msg = [ str(el[0]) + " " + str(el[1]) for el in msg ] msg.sort()

Re: setting the filename for download

2009-01-05 Thread m h
On Mon, Jan 5, 2009 at 10:20 AM, mk wrote: > > Hello everyone, > > I'm a beginner with Pylons and am trying to set the filename of a file > to download in an action (that is, controller method): > > def environ3(self): > msg = list(request.environ.items()) > msg = [ str(el[0])

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Wyatt Baldwin
On Jan 5, 9:56 am, Ben Bangert wrote: > On Jan 4, 2009, at 9:06 PM, Tycon wrote: > > > > > Another issue with url_for is the handling of query string parameters > > using keyword arguments. Currently any extra keyword arguments will be > > added to the generated URL as query string, for example:

Re: pylons.decorators.secure.https throws away the query string ?

2009-01-05 Thread Ian Bicking
Looking at news, this is only in trunk: http://svn.pythonpaste.org/Paste/Deploy/trunk/docs/news.txt Try: easy_install PasteDeploy==dev Tycon wrote: > PasteDeploy 1.3.2 > Paste 1.7.2 > > According to (non)-easy-install these are the "best" match version, > and it's "already the active version i

Authkit and users for mysql database

2009-01-05 Thread MBlauwbloeme
I already posted this question but I didn't get any response. I am a beginner wih Pylons and Authkit. I am using Debian unstable and all the packages within Debian for using Authkit. I developped a login form and now I want to use Authkit to give users permission to use the web application. Thes

Re: a better way to run multiple pylons apps?

2009-01-05 Thread Ian Bicking
eleith wrote: > i've got a domain: example.com > > i want to run ten different websites (sub1.example.com, > sub2.example.com sub10.example.com) > > a different pylons app will be running each of the 10 websites > > i'm proxying scgi from lighttpd (10 entries, each website running on > por

Re: pylons.decorators.secure.https throws away the query string ?

2009-01-05 Thread Tycon
there is another bug in that prefix middleware in that it's trying to strip out the SCRIPT_NAME prefix, which is wrong because that should already be stripped out by the webserver before forwarding the request (at least apache mod_proxy does). In general anything under a "Location" or "Alias" dire

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mike Orr
On Mon, Jan 5, 2009 at 11:13 AM, Wyatt Baldwin wrote: >> > Another issue with url_for is the handling of query string parameters >> > using keyword arguments. Currently any extra keyword arguments will be >> > added to the generated URL as query string, for example: >> >> > url_for('/page', arg='

Re: Authkit and users for mysql database

2009-01-05 Thread Dalius Dobravolskas
On Mon, Jan 5, 2009 at 9:15 PM, wrote: > > I already posted this question but I didn't get any response. > > I am a beginner wih Pylons and Authkit. > I am using Debian unstable and all the packages within Debian for using > Authkit. > I developped a login form and now I want to use Authkit to

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Wyatt Baldwin
On Jan 5, 11:57 am, "Mike Orr" wrote: > On Mon, Jan 5, 2009 at 11:13 AM, Wyatt Baldwin > > [snip] > > > Actually, I think I like the idea of making the query params into a > > single argument. It could be a string like a=1&b=2 or a dict. > > No!  Encouraging the user to do their own interpolation

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Tycon
And I dont like the trailing underscore idea, because it would be a mess to deal with in most common use cases like: params = dict(request.params) url = url_for('/page', **params) With the params dict suggestion this will be written into url = url_for('/page', params) But with trailing undersc

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Tycon
and users can easily concatenate the query string to the url by themselves, so not much point to allow that option. I like the params dict suggestion. On Jan 5, 12:11 pm, Wyatt Baldwin wrote: > On Jan 5, 11:57 am, "Mike Orr" wrote: > > > On Mon, Jan 5, 2009 at 11:13 AM, Wyatt Baldwin > > > [sni

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mike Orr
On Mon, Jan 5, 2009 at 12:35 PM, Tycon wrote: > > And I dont like the trailing underscore idea, because it would be a > mess to deal with in most common use cases like: > > params = dict(request.params) > url = url_for('/page', **params) > > With the params dict suggestion this will be written in

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mike Orr
On Mon, Jan 5, 2009 at 1:07 PM, Mike Orr wrote: > On Mon, Jan 5, 2009 at 12:35 PM, Tycon wrote: >> >> And I dont like the trailing underscore idea, because it would be a >> mess to deal with in most common use cases like: >> >> params = dict(request.params) >> url = url_for('/page', **params) >>

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Tycon
right and don't forget about adding the new "raw" (to avoid mapper lookup if true) and "external" (to avoid adding SCRIPT_NAME prefix if true) arguments, in addition to the "params" dict, so you will have a much better url_for On Jan 5, 1:07 pm, "Mike Orr" wrote: > On Mon, Jan 5, 2009 at 12:35 P

Re: a better way to run multiple pylons apps?

2009-01-05 Thread Graham Dumpleton
On Jan 6, 6:26 am, Ian Bicking wrote: > eleith wrote: > > i've got a domain: example.com > > > i want to run ten different websites (sub1.example.com, > > sub2.example.com sub10.example.com) > > > a different pylons app will be running each of the 10 websites > > > i'm proxying scgi from l

Re: setting the filename for download

2009-01-05 Thread Jorge Vargas
On Mon, Jan 5, 2009 at 3:11 PM, m h wrote: > > On Mon, Jan 5, 2009 at 10:20 AM, mk wrote: >> >> Hello everyone, >> >> I'm a beginner with Pylons and am trying to set the filename of a file >> to download in an action (that is, controller method): >> >> def environ3(self): >> msg = li

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Mark Ramm
> So what about having a 'params' argument but keeping the current > behavior if 'params' is not set. That would allow backward > compatibility. > > Then if 'params' is set and another argument doesn't correspond to any > path variable, I guess you'd raise an error. Well, what we did in tg2 was m

Re: setting the filename for download

2009-01-05 Thread Florent Aide
>> >> Here's what I'm using: >> >> >>response.headers["content-type"] = "application/vnd.ms-excel" >>response.headers["Content-Disposition"] = "attachment; >> filename=%s" % xls_filename >> >> cheers, > > yes, in the future please read mailing list archives, this has been > asked a

Using SQLAlchemy with Pylons -> Data queries and modifications

2009-01-05 Thread Vadim Khaskel
Hi all! I’m going through Using SQLAlchemy with Pylons tutorial and having problems with population of database. (Data queries and modifications). Tables from tutorials were created without problems. I have methode in my hello.py file: def loadinfo(self): mr_jones = model.

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Tycon
Also lets not forget that keyword args can't represent a multi-dict which is allowed for the request parameters. That's why it was a bad idea from the start to use keyword args for the params. On Jan 5, 5:57 pm, "Mark Ramm" wrote: > > So what about having a 'params' argument but keeping the curr

Re: url_for / redirect_to RAW mode

2009-01-05 Thread Wyatt Baldwin
I'm not sure it was such a "bad idea." It was a first pass and works well for a large number of cases. It's unrealistic to expect perfection from the get-go (or ever, really), and for all you or I know, the current implementation *is* perfect, for some value of perfect, for some users. Regardless

Re: Using SQLAlchemy with Pylons -> Data queries and modifications

2009-01-05 Thread Dalius Dobravolskas
Hello, Vadim, > def loadinfo(self): > > mr_jones = model.Person() > > mr_jones.name = 'Mr Jones' > > model.meta.Session.save(mr_jones) > > model.meta.Session.commit() The problem is in how you have created session. Since I don't know what's your SqlAlchemy version

redirect_to in __init__ ?

2009-01-05 Thread Jonathan Vanasco
is there a way to handle a redirect_to in an __init__ , or does it need to be in __before__ ? pylons executes the code 'right' in an __init__ block, but breaks with the "raise found" --~--~-~--~~~---~--~~ You received this message because you are subscribed to the