Re: [Catalyst] TT VMethods

2007-09-13 Thread Felix Antonius Wilhelm Ostmann
i use another easy way: package C::V::TT; use strict; use base 'Catalyst::View::TT'; __PACKAGE__-config( { CATALYST_VAR = 'catalyst', ... FILTERS = { 'dollar' = sub { sprintf('%.2f',$_[0]); }, } }, ); so you can use it in the Template like this:

Re: [Catalyst] + in GET param

2007-09-13 Thread Gavin Henry
quote who=Tatsuhiko Miyagawa As discussed on IRC, this seems to be a bug introduced around Catalyst 5.708. I got a commit bit from Jay (thanks!) and committed the fix with test suite. http://dev.catalystframework.org/svnweb/Catalyst/revision/?rev=6873 Yeah, thanks. For others, the bug was

[Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Hi My existing Catalyst application is being extended. I want to keep a record of previous passwords used by a user to prevent them being re-used. I have Model 'UsedPassword' to keep track of the previous 8 (say) passwords as so- package MyApp::Schema::UsedPassword; use strict; use base

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
I have found a thread on DBIx-class mailing list that throws some light on this using http://search.cpan.org/~ash/DBIx-Class-0.08006/lib/DBIx/Class/Schema.pm#load_namespaces This seems to solve the problem for putting such logic into the Model/Schema but would it be better to put this type of

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Will Hawes
On 13/09/2007, Ian Docherty [EMAIL PROTECTED] wrote: I have found a thread on DBIx-class mailing list that throws some light on this using http://search.cpan.org/~ash/DBIx-Class-0.08006/lib/DBIx/Class/Schema.pm#load_namespaces This seems to solve the problem for putting such logic into the

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Will Hawes wrote: ... Isn't this just a case of adding a create_limited() method to your model class? package MyApp::Schema::UsedPassword; ... sub create_limited { my( $self, $user, $password ) = @_; # password checking logic here } In your controller:

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
My application has (effectively, subject to some cut and paste) the following. package MyApp::Schema; use strict; use warning; use base qw(DBIx::Class::Schema); __PACKAGE__-load_classes(qw( UsedPassword )); 1; package MyApp::Schema::UsedPassword; use

[Catalyst] printing the generated SQL

2007-09-13 Thread Octavian Rasnita
Hi, Is it possible to log a certain SQL which is generated in a Catalyst application by a controller that uses a DBIx::Class model? Thank you. Octavian ___ List: Catalyst@lists.rawmode.org Listinfo:

Re: [Catalyst] Best way to validate Chained actions?

2007-09-13 Thread Christopher H. Laco
Micah Jaffe wrote: I'm trying to figure out the best[*] way to validate Chained actions at various points along the action chain. By validate, I mean check if the action should proceed or bomb out. Validation is not the same as authentication; I may be logged in but I may not have

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Will Hawes
On 13/09/2007, Ian Docherty [EMAIL PROTECTED] wrote: My application has (effectively, subject to some cut and paste) the following. package MyApp::Schema; use strict; use warning; use base qw(DBIx::Class::Schema); __PACKAGE__-load_classes(qw( UsedPassword ));

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Simon Wilcox
Will Hawes wrote: Whoops, my bad. $c-model() does indeed return a DBIx::Class::ResultSet, so you would need to retrieve/create an instance of your UsedPassword class from the resultset in order to call any methods on it: my $used_password = $c-model('DBIC::UsedPassword')-create( { user =

Re: [Catalyst] Best way to validate Chained actions?

2007-09-13 Thread Matt S Trout
On Thu, Sep 13, 2007 at 08:41:24AM -0400, Christopher H. Laco wrote: Micah Jaffe wrote: I'm trying to figure out the best[*] way to validate Chained actions at various points along the action chain. By validate, I mean check if the action should proceed or bomb out. Validation is not the

Re: [Catalyst] printing the generated SQL

2007-09-13 Thread Emanuele Zeppieri
Octavian Rasnita wrote: Hi, Is it possible to log a certain SQL which is generated in a Catalyst application by a controller that uses a DBIx::Class model? $c-model('MyModel')-storage-debug(1); Also have a look at: http://search.cpan.org/dist/DBIx-Class-QueryLog/

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Matt S Trout
On Thu, Sep 13, 2007 at 10:58:08AM +0100, Ian Docherty wrote: I have found a thread on DBIx-class mailing list that throws some light on this using http://search.cpan.org/~ash/DBIx-Class-0.08006/lib/DBIx/Class/Schema.pm#load_namespaces This seems to solve the problem for putting such

Re: [Catalyst] printing the generated SQL

2007-09-13 Thread Matt S Trout
On Thu, Sep 13, 2007 at 03:35:46PM +0300, Octavian Rasnita wrote: Hi, Is it possible to log a certain SQL which is generated in a Catalyst application by a controller that uses a DBIx::Class model? Yes. -- Matt S Trout Need help with your Catalyst or DBIx::Class project?

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Matt S Trout
On Thu, Sep 13, 2007 at 10:27:04AM +0100, Ian Docherty wrote: Hi My existing Catalyst application is being extended. I want to keep a record of previous passwords used by a user to prevent them being re-used. I have Model 'UsedPassword' to keep track of the previous 8 (say) passwords as

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ian Docherty
Simon Wilcox wrote: Will Hawes wrote: Whoops, my bad. $c-model() does indeed return a DBIx::Class::ResultSet, so you would need to retrieve/create an instance of your UsedPassword class from the resultset in order to call any methods on it: my $used_password =

Re: [Catalyst] TT VMethods

2007-09-13 Thread J. Shirley
On 9/12/07, Mitchell Jackson [EMAIL PROTECTED] wrote: Today I saw how easy it is to extend Template-Toolkit within Catalyst. Perhaps somebody here will find this useful. I wanted to easily format dollar amounts from within the tt2 template. I had been doing this with [% FILTER format( %.2f )

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Matt S Trout
On Thu, Sep 13, 2007 at 03:14:58PM +0100, Ian Docherty wrote: Simon Wilcox wrote: Will Hawes wrote: Whoops, my bad. $c-model() does indeed return a DBIx::Class::ResultSet, so you would need to retrieve/create an instance of your UsedPassword class from the resultset in order to call any

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Jonathan Rockway
Ian Docherty wrote: As I mentioned, if I try to do a call to $c-model('DBIC::UsedPassword')-create_limited( ... ); I get the fatal error Can't locate object method create_limited via package DBIx::Class::ResultSet Which is why I think this is not the approach, unless you know otherwise?

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Simon Wilcox
Matt S Trout wrote: On Thu, Sep 13, 2007 at 03:14:58PM +0100, Ian Docherty wrote: Almost, if I do my $used_password = $c-model('DBIC::UsedPassword')-result_class-create_limited(); it works. So that should do for now, thanks Simon and Will for your help ;) No. Don't do that. Really don't.

Re: [Catalyst] Some guidance needed please

2007-09-13 Thread Ash Berlin
Simon Wilcox wrote: Matt S Trout wrote: On Thu, Sep 13, 2007 at 03:14:58PM +0100, Ian Docherty wrote: Almost, if I do my $used_password = $c-model('DBIC::UsedPassword')-result_class-create_limited(); it works. So that should do for now, thanks Simon and Will for your help ;) No. Don't do