Re: [Catalyst] default template

2006-12-29 Thread vb
Since the code in RenderView is so small, I'm going to paste it here and tell you why each line there is important. ## comments are my notes . A very good (step-) tutorial! (simply) Commenting So, many Catalyst things - will assure more understanding than the usual "tutorials"! --vb On 12/

Re: [Catalyst] RFC for Catalyst enabled GWT clone

2006-12-29 Thread Nilson Santos Figueiredo Junior
On 12/29/06, John Napiorkowski <[EMAIL PROTECTED]> wrote: So I guess my question is would people like a GWT like system for Catalyst and if so what would you like to see in it? I've been thinking a lot about these sort of things lately but I couldn't come up with a clean way to do it the way I

Re: [Catalyst] Create multiple records

2006-12-29 Thread Juan Miguel Paredes
On 12/29/06, Will Smith <[EMAIL PROTECTED]> wrote: Thank you, Yes, I mean I'm using DBIC. I've tried your method. It did not give error, but, also did not insert into the table. Do I miss something? Hi, Will! Are the correct SQL statements being generated? (try export DBI_TRACE=1 or somethi

[Catalyst] RFC for Catalyst enabled GWT clone

2006-12-29 Thread John Napiorkowski
Since it's Friday before the holiday (for me in the USA at least) I thought to share some random speculation with the list. I've been working a bit with the Google Web Toolkit as part of my day job and although I really love the idea behind it I don't love the Java complications of it and was thin

Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Dennis Daupert
Leandro: > you don't need to use Data::Page directly yes, you are quite right, I took out the explicit call to Data::Page; I set rows => 2, and my query gets 2 thumbs. Cool. >you are setting $c->stash->{photos} to an >array reference when you do >$c->stash->{photos} = [$c->model( ... ]; >and

Re: [Catalyst] default template

2006-12-29 Thread Jonathan Rockway
Octavian Rasnita wrote: > sub end : ActionClass('RenderView') { > my ($self, $c) = @_; > $c->forward($c->view('TT')); > } This will skip all of RenderView's nice features. Use sub end : ActionClass('RenderView') {} instead. -- package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name =>

Re: [Catalyst] default template

2006-12-29 Thread Octavian Rasnita
Ok, thank you for this code. I haven't seen very many explanations about RenderView, so I didn't understand how it works. So I have used only RenderView until now, but not very smart, something like: sub end : ActionClass('RenderView') { my ($self, $c) = @_; $c->forward($c->view('TT')); }

Re: [Catalyst] default template

2006-12-29 Thread John Napiorkowski
--- Octavian Rasnita <[EMAIL PROTECTED]> wrote: > From: "Eden Cardim" <[EMAIL PROTECTED]> > > > No, there isn't. Catalyst only emits the response > after all the > > actions are dispatched. One way you can keep the > end action from > > running is by not having one. In your case, set up > a Cont

Re: [Catalyst] default template

2006-12-29 Thread Octavian Rasnita
Ok, I will read about RenderView. I have discovered that I could use something like the following in the end subroutine: $c->forward($c->view('TT')) unless $c->res->body or $c->res->redirect; This way the end subroutine doesn't print anything and it doesn't need using the TT view if there is

Re: [Catalyst] default template

2006-12-29 Thread Octavian Rasnita
From: "Eden Cardim" <[EMAIL PROTECTED]> No, there isn't. Catalyst only emits the response after all the actions are dispatched. One way you can keep the end action from running is by not having one. In your case, set up a Controller without an end action just for authentication. In there, you ca

Re: [Catalyst] Create multiple records

2006-12-29 Thread Will Smith
Thank you, Yes, I mean I'm using DBIC. I've tried your method. It did not give error, but, also did not insert into the table. Do I miss something? Jonathan Rockway <[EMAIL PROTECTED]> wrote: Will Smith wrote: > Hi, > Could someone please show me the syntax to create multiple records. For > e

Re: [Catalyst] default template

2006-12-29 Thread Jonathan Rockway
Octavian Rasnita wrote: > Hi, > > I often need to make external redirections like in the following case: > > sub logout : Local { > my ($self, $c) = @_; > $c->logout; > $c->res->redirect($c->uri_for("/")); > } How about $c->detach() after the redirect? BTW, I notice a common theme in your posts -

Re: [Catalyst] Create multiple records

2006-12-29 Thread Jonathan Rockway
Will Smith wrote: > Hi, > Could someone please show me the syntax to create multiple records. For > example my table book has 3 fields : id (auto_increment), title, price. > On the template I have 3 rows of title/price. I want to enter 3 book > titles and prices and create at the same time. > With

Re: [Catalyst] Re: Accessing $c from Model

2006-12-29 Thread Christopher H. Laco
Daniel McBrearty wrote: > FWIW ... : what I've noticed about using models (or not) ... : > > 1. the advantage of using a model mostly seems to be that it > autoloads, and then is accessible everywhere from $c. Otherwise, there > doesn't seem to be much difference from just having a normal perl > l

Re: [Catalyst] Re: Accessing $c from Model

2006-12-29 Thread Daniel McBrearty
FWIW ... : what I've noticed about using models (or not) ... : 1. the advantage of using a model mostly seems to be that it autoloads, and then is accessible everywhere from $c. Otherwise, there doesn't seem to be much difference from just having a normal perl library. 2. so if you just need dat

Re: [Catalyst] default template

2006-12-29 Thread Eden Cardim
On 12/29/06, Octavian Rasnita <[EMAIL PROTECTED]> wrote: Hi, I often need to make external redirections like in the following case: sub logout : Local { my ($self, $c) = @_; $c->logout; $c->res->redirect($c->uri_for("/")); } When I access /user/logout for executing this subroutine, it prints t

Re: [Catalyst] default template

2006-12-29 Thread John Napiorkowski
--- Octavian Rasnita <[EMAIL PROTECTED]> wrote: > Hi, > > I often need to make external redirections like in > the following case: > > sub logout : Local { > my ($self, $c) = @_; > $c->logout; > $c->res->redirect($c->uri_for("/")); > } > > When I access /user/logout for executing this > subrou

[Catalyst] default template

2006-12-29 Thread Octavian Rasnita
Hi, I often need to make external redirections like in the following case: sub logout : Local { my ($self, $c) = @_; $c->logout; $c->res->redirect($c->uri_for("/")); } When I access /user/logout for executing this subroutine, it prints the following error: Coldn't render template "file error

[Catalyst] Create multiple records

2006-12-29 Thread Will Smith
Hi, Could someone please show me the syntax to create multiple records. For example my table book has 3 fields : id (auto_increment), title, price. On the template I have 3 rows of title/price. I want to enter 3 book titles and prices and create at the same time. With the old syntax, I can do

Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Brandon Black
On 12/29/06, Chisel Wright <[EMAIL PROTECTED]> wrote: On Fri, Dec 29, 2006 at 08:35:34AM -0800, Dennis Daupert wrote: >$c->stash->{photos} = [$c->model('CatapultDB::Photos')->search( ... >)]; > >$c->stash->{pager} => $c->stash->{photos}->pager(); # ??? I think you need to los

Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Chisel Wright
On Fri, Dec 29, 2006 at 08:35:34AM -0800, Dennis Daupert wrote: >$c->stash->{photos} = [$c->model('CatapultDB::Photos')->search( ... >)]; > >$c->stash->{pager} => $c->stash->{photos}->pager(); # ??? I think you need to lose the square brackets, and you will probably find you t

Re: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Chisel Wright
On Fri, Dec 29, 2006 at 08:35:34AM -0800, Dennis Daupert wrote: >$c->stash->{pager} => $c->stash->{photos}->pager(); # ??? Probably not the root of the problem, but shouldn't this be an assignment rather than a fat-comma? Chisel -- Chisel Wright e: [EMAIL PROTECTED] w: http://www.herlpacker.

RE: [Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Hermida, Leandro
> From: Dennis Daupert [mailto:[EMAIL PROTECTED] > > Line below marked # ??? gives the error; removing that line, I can select a gallery and display the images -- but without paging. > > # - - - - - - - - - - - - - - - - - - > package Catapult::Controller::Photo::Gallery; > # - - - - -

[Catalyst] DBIx::Class/TT Pager Question

2006-12-29 Thread Dennis Daupert
I'm having a bit of a go of getting all the bits in place to do paging. The error I'm hung on is: "Can't call method "pager" on unblessed reference" Here's the story: My display template first asks the user to select a gallery to display, then displays a list of thumbnail images. My controller 1

[Catalyst] issues with C::P::Authentication::Store::DBIC

2006-12-29 Thread Octavian Rasnita
Hi, I have seen that if I don't use $c->user in the program or templates, the application works fine if I use Authentication::Store::Htpasswd. However, after this test, if I switch back to Authentication::Store::DBIC, the program gives again that 404 Not Found error and prints the following er

Re: [Catalyst] debugging the login

2006-12-29 Thread Ash Berlin
Octavian Rasnita wrote: From: "Ash Berlin" <[EMAIL PROTECTED]> "Something else" is the case here. If you try "$c->user;" in a controller I suspect it will give you same error as from the template. As to the exact cause, hard to say, but its something to do with authentication setup. Aha,

Re: [Catalyst] debugging the login

2006-12-29 Thread Octavian Rasnita
From: "Ash Berlin" <[EMAIL PROTECTED]> "Something else" is the case here. If you try "$c->user;" in a controller I suspect it will give you same error as from the template. As to the exact cause, hard to say, but its something to do with authentication setup. Aha, so it is a known issue? D