Re: [Catalyst] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote: > If you don't need transaction you don't use it. This is not we talking > about. To use transaction or not in every case is a high-level logic > decision I disagree. That /is/ what we are talking about - unless MySQL cannot tell you that the database connection has evaporated wh

Re: [Catalyst] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote: > If you don't need transaction you don't use it. This is not we talking > about. To use transaction or not in every case is a high-level logic > decision I disagree. That /is/ what we are talking about - unless MySQL cannot tell you that the database connection has evaporated wh

Re: [Catalyst] query once per session?

2007-04-27 Thread Yuval Kogman
On Fri, Apr 27, 2007 at 10:32:15 -0700, Michael Higgins wrote: > Ah. Well, I got something working, I believe, using Cache::FileCache... > which is marginally faster than retreieving it every time. Probably, I need > a different cache method. I recommend Cache::FastMmap. New versions of that modu

Re: [Catalyst] CC::FormBuilder woes

2007-04-27 Thread Juan Camacho
On 4/27/07, RA Jones <[EMAIL PROTECTED]> wrote: Peter Edwards wrote: If fields is a list reference you need something like [% form.fields.0.label %] http://www.template-toolkit.org/docs/aqua/Manual/Variables.html#Hash_Array_R eferences Oh dear, that works! But it's not what I want as I ca

Re: [Catalyst] MySQL server has gone away

2007-04-27 Thread Oleg Pronin
If you don't need transaction you don't use it. This is not we talking about. To use transaction or not in every case is a high-level logic decision 2007/4/27, Jeff Chimene <[EMAIL PROTECTED]>: Oleg Pronin wrote: > One can say that it is a very rare situation. I can tell you that in > productio

Re: [Catalyst] Re: Redirects // Re: forwarding to chained actions

2007-04-27 Thread Bill Moseley
On Fri, Apr 27, 2007 at 10:30:01PM +0200, A. Pagaltzis wrote: > Various nitpickery corrected: > > sub post_redirect { > my ( $c, $loc ) = @_; > > my $is_rel_uri = $loc !~ m{ :// }x; > > my $is_old_proto = do { > my $p = $c->request->protocol; >

[Catalyst] Re: Redirects // Re: forwarding to chained actions

2007-04-27 Thread A. Pagaltzis
* Bill Moseley <[EMAIL PROTECTED]> [2007-04-27 20:55]: > sub post_redirect { > my ( $c, $location ) = @_; > my ($version) = $c->request->protocol =~ m/(\d+\.\d+)/; > > # Make location absolute > $location = $c->uri_for( $location ) > unless $location =~ /http/; > > $c-

Re: [Catalyst] How to pass vars to modules

2007-04-27 Thread RA Jones
Dave Rolsky wrote: On Fri, 27 Apr 2007, RA Jones wrote: If your plugin starts with a name other than Catalyst::Plugin::, you can Right - I managed to miss the significance of the plugin bit! -- Richard Jones Leeds, UK ___ List: Catalyst@lists.rawmod

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Christian Storm
Or m/\A http/xims if you are Damian Conway or worried about PBP. FYI HTTP is also valid. On Apr 27, 2007, at 11:55 AM, Dave Rolsky wrote: On Fri, 27 Apr 2007, Bill Moseley wrote: sub post_redirect { my ( $c, $location ) = @_; my ($version) = $c->request->protocol =~ m/(\d+\.\d+)/;

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Christopher H. Laco
Dave Rolsky wrote: > On Fri, 27 Apr 2007, Bill Moseley wrote: > >> sub post_redirect { >>my ( $c, $location ) = @_; >>my ($version) = $c->request->protocol =~ m/(\d+\.\d+)/; >> >># Make location absolute >>$location = $c->uri_for( $location ) >>unless $location =~ /http/; >

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Dave Rolsky
On Fri, 27 Apr 2007, Bill Moseley wrote: sub post_redirect { my ( $c, $location ) = @_; my ($version) = $c->request->protocol =~ m/(\d+\.\d+)/; # Make location absolute $location = $c->uri_for( $location ) unless $location =~ /http/; I'd make that regex /^http/ It's not in

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Bill Moseley
On Fri, Apr 27, 2007 at 02:03:23PM +0100, Simon Wilcox wrote: > So, what do people do - do you send 303/307's "correctly" or just default > to 302 behaviour ? I use something like this, although you might want to customize: sub post_redirect { my ( $c, $location ) = @_; my ($version) = $c

[Catalyst] Re: Redirects // Re: forwarding to chained actions

2007-04-27 Thread A. Pagaltzis
* Simon Wilcox <[EMAIL PROTECTED]> [2007-04-27 15:10]: > So, what do people do - do you send 303/307's "correctly" or > just default to 302 behaviour? I send 303, unless the HTTP request uses HTTP 1.0, in which case the client sees a 302 instead. Regards, -- Aristotle Pagaltzis //

Re: [Catalyst] Catalyst::Model::DBIC::Schema or not?

2007-04-27 Thread John Napiorkowski
- Original Message From: Jason Gottshall <[EMAIL PROTECTED]> To: The elegant MVC web framework Sent: Friday, April 27, 2007 12:54:39 PM Subject: RE: [Catalyst] Catalyst::Model::DBIC::Schema or not? Brian Kirkbride wrote: > Jason Gottshall wrote: > > Brian Kirkbride wrote: > > > I usual

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread John Napiorkowski
- Original Message From: Michael Reece <[EMAIL PROTECTED]> To: The elegant MVC web framework Sent: Friday, April 27, 2007 12:27:29 PM Subject: Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions it would be nice if $c->res->redirect returned a 303 appropriately if $c->re

RE: [Catalyst] query once per session?

2007-04-27 Thread Michael Higgins
> From: Yuval Kogman [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 26, 2007 3:04 PM > > On Thu, Apr 26, 2007 at 14:35:09 -0700, Michael Higgins wrote: > > Hello, > > > > I'm wondering how I can get a query (that becomes a > drop-down list for > > a form field) set to execute only once and

RE: [Catalyst] Catalyst::Model::DBIC::Schema or not?

2007-04-27 Thread Dave Rolsky
On Fri, 27 Apr 2007, Jason Gottshall wrote: I tried eliminating Catalyst::Model::DBIC::Schema in favor of having my true business Models do all the interfacing with DBIC. No problem with those Models, but I did discover an unintended consequence: Catalyst::PluginDBIC stuff stopped working!

Re: [Catalyst] How to pass vars to modules

2007-04-27 Thread Dave Rolsky
On Fri, 27 Apr 2007, RA Jones wrote: If your plugin starts with a name other than Catalyst::Plugin::, you can ^^ That's the key. -dave /*=== VegGuide.Orgwww.BookIRead.com Your guide to all that's veg.

RE: [Catalyst] Catalyst::Model::DBIC::Schema or not?

2007-04-27 Thread Jason Gottshall
Brian Kirkbride wrote: > Jason Gottshall wrote: > > Brian Kirkbride wrote: > > > I usually have an architecture like this: > > > > > > Client -> Controller -> Model -> ORM -> Database > > > > > > The ORM is usually just vanilla (as you suggested), the Database > > > enforces simple > > > data con

Re: [Catalyst] How to pass vars to modules

2007-04-27 Thread Daniel Hulme
On Fri, Apr 27, 2007 at 05:06:40PM +0100, RA Jones wrote: > Dave Rolsky wrote: > >Where in the tutorial does it suggest you load non-Catalyst modules > >like this? > > > > > Sorry, it wasn't the tutorial, but the catalyst POD under the > Description section: > > If your plugin starts with a name

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Michael Reece
it would be nice if $c->res->redirect returned a 303 appropriately if $c->req->method eq 'POST'. i have in the past trapped it in 'end' to fix up the $c->res->status if == 302 and $c->req->method eq 'POST', but lately i just don't bother. On Apr 27, 2007, at 6:03 AM, Simon Wilcox wrote: O

Re: [Catalyst] perl -d myapp_server.pl : how ?

2007-04-27 Thread Michael Reece
i usually stick $DB::single=1 at the top of the controller method i am debugging, then perl -d ./script/myapp_server.pl it then drops to the debugger prompt after i make the http request. On Apr 27, 2007, at 5:04 AM, Dami Laurent ((PJ)) wrote: Hello, The question was already asked in the lis

Re: [Catalyst] MySQL server has gone away

2007-04-27 Thread Jeff Chimene
Oleg Pronin wrote: > One can say that it is a very rare situation. I can tell you that in > production environment (about 1.000.000 hits per day) it happens every > day several times. Some users just see an error, some lost their data. > This is just not always visible to you. The OP may find a req

Re: Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread John Napiorkowski
- Original Message From: Simon Wilcox <[EMAIL PROTECTED]> To: The elegant MVC web framework Sent: Friday, April 27, 2007 9:03:23 AM Subject: Redirects // Re: [Catalyst] Re: forwarding to chained actions On Tue, 24 Apr 2007, A. Pagaltzis wrote: > _ALL_ POSTs should be followed by a red

Re: [Catalyst] How to pass vars to modules

2007-04-27 Thread RA Jones
Dave Rolsky wrote: On Thu, 26 Apr 2007, RA Jones wrote: Just for information, why do you say that? The tutorial suggests doing just that. Doing that to load non-Catalyst plugins buys you nothing, and obscures how modules are loaded. For example, when I want to find all the modules I'm using

Re: [Catalyst] CC::FormBuilder woes

2007-04-27 Thread RA Jones
Peter Edwards wrote: If fields is a list reference you need something like [% form.fields.0.label %] http://www.template-toolkit.org/docs/aqua/Manual/Variables.html#Hash_Array_R eferences Oh dear, that works! But it's not what I want as I can't easily force specific fields where I want the

Re: [Catalyst] Catalyst Engine Start-up Flag?

2007-04-27 Thread Brian Cassidy
Lee Goddard wrote: Sorry: I meant when the server starts, it seems to attempt to call 'new' for every *.pm in MyApp::Model::* : Hopefully I recall how this works... Every Model::*, Controller::*, View::* (plus their short-names for back-compat) are instantiated via setup_components (see Cata

[Catalyst] Re: perl -d myapp_server.pl : how ?

2007-04-27 Thread rahed
"Dami Laurent (PJ)" <[EMAIL PROTECTED]> writes: > Did anybody succeed in running the standalone server in debug mode ? I run it as perl -d myapp_server.pl though it's on Solaris, not on Windows. -- Radek ___ List: Catalyst@lists.rawmode.org Listinfo

Re: [Catalyst] Catalyst Engine Start-up Flag?

2007-04-27 Thread Marcello Romani
Lee Goddard ha scritto: From: Marcello Romani [mailto:[EMAIL PROTECTED] Lee Goddard ha scritto: Is there a variable somewhere that can tell me when Catalyst's dev-server is starting up? Because it seems to be calling every method I've written, but without parameters, which intentionally cau

RE: [Catalyst] CC::FormBuilder woes

2007-04-27 Thread Peter Edwards
If fields is a list reference you need something like [% form.fields.0.label %] http://www.template-toolkit.org/docs/aqua/Manual/Variables.html#Hash_Array_R eferences Regards, Peter Dragonstaff Limited http://www.dragonstaff.com -Original Message- From: RA Jones [mailto:[EMAIL PROTECTE

Redirects // Re: [Catalyst] Re: forwarding to chained actions

2007-04-27 Thread Simon Wilcox
On Tue, 24 Apr 2007, A. Pagaltzis wrote: > _ALL_ POSTs should be followed by a redirect, ALWAYS. This is really good advice but I was looking at the response code RFC today [1] for an unrelated matter and found the following: If the 302 status code is received in response to a request other th

RE: [Catalyst] Catalyst Engine Start-up Flag?

2007-04-27 Thread Lee Goddard
From: Marcello Romani [mailto:[EMAIL PROTECTED] > Lee Goddard ha scritto: > > Is there a variable somewhere that can tell me when Catalyst's > > dev-server is starting up? Because it seems to be calling every method > > I've written, but without parameters, which intentionally causes errors >

[Catalyst] CC::FormBuilder woes

2007-04-27 Thread RA Jones
Apologies if this not the right forum for this (but if not, where else ?). According to the FormBuilder docs, the following code in my template should (and does) work: [% FOREACH field IN form.fields %] [% field.label %] [% field.field%] [% END %] But so should this (and doesn't): [% form.fiel

Re: [Catalyst] Catalyst Engine Start-up Flag?

2007-04-27 Thread Marcello Romani
Lee Goddard ha scritto: Is there a variable somewhere that can tell me when Catalyst’s dev-server is starting up? Because it seems to be calling every method I’ve written, but without parameters, which intentionally causes errors when in production, but shouldn’t during automated tests.

Re: [Catalyst] OT: ack

2007-04-27 Thread Marcello Romani
A. Pagaltzis ha scritto: * Dave Rolsky <[EMAIL PROTECTED]> [2007-04-27 02:40]: For example, when I want to find all the modules I'm using, I usually do something like this: grep -r '^use ' As a sidenote, do check out App::Ack, which installs the `ack` tool. Much nicer than grep(1) for sourc

[Catalyst] perl -d myapp_server.pl : how ?

2007-04-27 Thread Dami Laurent \(PJ\)
Hello, The question was already asked in the list, but I can't remember of any satisfying answer. Did anybody succeed in running the standalone server in debug mode ? Seems that the server main loop, waiting for HTTP events, is not compatible with the debugger loop waiting for keyboard events.

[Catalyst] Catalyst Engine Start-up Flag?

2007-04-27 Thread Lee Goddard
Is there a variable somewhere that can tell me when Catalyst's dev-server is starting up? Because it seems to be calling every method I've written, but without parameters, which intentionally causes errors when in production, but shouldn't during automated tests. Thanks in anticipation Lee _

[Catalyst] catalyst on OpenBSD

2007-04-27 Thread Marc Espie
I'm happy to say that we now have catalyst in a stable state on OpenBSD. We have most modules in the ports tree, a large subset of plugins working. And DBIx::Class::C3_XS should join us next week. So a newcomer can now just do pkg_add catalyst_tutorial and start playing. Can someone please adjust