On Fri, May 11, 2007 at 11:51:45AM +0100, RA Jones wrote:
> Matt S Trout wrote:
> >On Fri, May 11, 2007 at 10:42:56AM +0100, RA Jones wrote:
> >
> >>Using formbuilder object in the controller and InflateColumns::DateTime
> >>in the model, it should be possible to retrieve field definitions like:
> >>
> >>my $form = $self->formbuilder; # CCF object
> >>my @date_fields = grep { $_->get_field_types } keys %{ $form->field };
> >>
> >>I just can't work out what get_field_types in the grep block should be.
> >>
> >
> >$schema->source('Foo')->column_info($_)->{data_type} eq 'datetime'
> >
> >
> In a Cat controller, the equivalent of $schema->source('Foo') is
> $c->model->('Schema::Foo') ?
Nope.
$c->model('Schema')->schema->source('Foo')
or
$c->model('Schema::Foo')->result_source
see the Catalyst::Model::DBIC::Schema, DBIx::Class::Schema,
DBIx::Class::ResultSet and DBIx::Class::ResultSource POD for more info.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcatsystems.co.uk/
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/