[Catalyst-commits] r11032 - in trunk/Catalyst-Example-InstantCRUD:
. lib/Catalyst/Example lib/Catalyst/Example/Controller
zby at dev.catalyst.perl.org
zby at dev.catalyst.perl.org
Wed Aug 5 16:34:32 GMT 2009
Author: zby
Date: 2009-08-05 16:34:32 +0000 (Wed, 05 Aug 2009)
New Revision: 11032
Modified:
trunk/Catalyst-Example-InstantCRUD/Makefile.PL
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
Log:
prereqs added
Modified: trunk/Catalyst-Example-InstantCRUD/Makefile.PL
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/Makefile.PL 2009-08-05 14:13:02 UTC (rev 11031)
+++ trunk/Catalyst-Example-InstantCRUD/Makefile.PL 2009-08-05 16:34:32 UTC (rev 11032)
@@ -28,13 +28,15 @@
# 'Catalyst::Plugin::Authentication::Credential::Password' => 0,
'Catalyst::Plugin::Session::State::Cookie' => 0,
'Catalyst::Plugin::Session::Store::FastMmap' => 0,
- 'HTML::FormHandler::Generator::DBIC' => 0.02,
+ 'HTML::FormHandler::Generator::DBIC' => 0.03,
+ 'HTML::FormHandler::Model::DBIC' => 0.04,
'HTML::FormHandler' => 0.26,
'Path::Class' => 0,
# 'URI::Escape' => 0,
'File::Slurp' => 0,
'Pod::Usage' => 0,
'List::Util' => 0,
+ 'String::Random' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Catalyst-Example-InstantCRUD-*' },
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-08-05 14:13:02 UTC (rev 11031)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/Controller/InstantCRUD.pm 2009-08-05 16:34:32 UTC (rev 11032)
@@ -19,6 +19,12 @@
return $1;
}
+has form_class => ( isa => 'Str', is => 'rw', lazy => 1, builder => 'build_form_class' );
+sub build_form_class {
+ my $self = shift;
+ return ref( $self ) . '::' . $self->source_name . 'Form';
+}
+
sub auto : Local {
my ( $self, $c ) = @_;
$c->stash->{additional_template_paths} = [ dir( $c->config->{root}, lc $self->source_name) . '', $c->config->{root} . ''];
@@ -70,10 +76,9 @@
sub edit : Local {
my ( $self, $c, @pks ) = @_;
- my $form_name = ref( $self ) . '::' . $self->source_name . 'Form';
my @ids;
@ids = ( item_id => [ @pks ] ) if @pks;
- my $form = $form_name->new(
+ my $form = $self->form_class->new(
schema => $self->model_schema($c),
params => $c->req->params,
@ids,
Modified: trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm
===================================================================
--- trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-08-05 14:13:02 UTC (rev 11031)
+++ trunk/Catalyst-Example-InstantCRUD/lib/Catalyst/Example/InstantCRUD.pm 2009-08-05 16:34:32 UTC (rev 11032)
@@ -1,6 +1,6 @@
package Catalyst::Example::InstantCRUD;
-$VERSION = '0.033';
+$VERSION = '0.034';
use warnings;
use strict;
More information about the Catalyst-commits
mailing list